Integrate and Classify Normals · Getting started

Tools to integrate normal (Gaussian) distributions in any dimensions with any parameters within any domain, compute pdf/cdf/inverse cdf of any function of a normal vector, and compute quantities concerning classification performance among two or more multinormals, such as error matrix and discriminability d'.
For function help, type:
doc integrate_normal
doc classify_normals
doc classify_normals_multi
doc norm_fun_cdf
doc norm_fun_pdf
doc norm_fun_inv
Please cite: A new method to compute classification error.
Abhranil Das, Center for Perceptual Systems, University of Texas at Austin
Bugs/questions/comments to abhranil.das@utexas.edu.

Integrate normal in 1d

Define normal parameters, and a quadratic function of it, -x^2+x+1, i.e. q(x)= -1*x^2 + 1*x + 1:
mu=-2; v=3;
quad.q2=-1;
quad.q1=1;
quad.q0=1;

Integrate the normal probability in the quadratic domain defined by q(x)>0:

p=integrate_normal(mu,v,quad)
p = 0.1941
Most plots can be zoomed and panned.

pdf/cdf/inverse cdf of q(x)

p=norm_fun_cdf([0 1 2],mu,v,quad)
p = 1×3
0.8059 0.9175 1.0000
f=norm_fun_pdf([0 1 2],mu,v,quad)
f = 1×3
0.0865 0.1696 0
fplot(@(x) norm_fun_pdf(x,mu,v,quad),[-30 5]); ylabel 'pdf'
% 1st, 2nd and 3rd quartiles
x=norm_fun_inv([0.25 0.5 0.75],mu,v,quad)
x = 1×3
-12.2134 -5.0417 -0.7030

normal probability in the domain defined by a non-quadratic function f(x) =\cos x^2>0

fun=@(x) cos(x.^2);
[p,pc,bd_pts]=integrate_normal(mu,v,fun,'dom_type','fun','fun_span',5,'fun_resol',500)
p = 0.5803
pc = 0.4197
bd_pts = 1×100
-10.5606 -10.4108 -10.2588 -10.1045 -9.9479 -9.7887 -9.6269 -9.4623 -9.2948 -9.1243 -8.9505 -8.7732 -8.5923 -8.4075 -8.2185 -8.0251 -7.8269 -7.6236 -7.4147 -7.1997 -6.9782 -6.7493 -6.5124 -6.2666 -6.0107 -5.7434 -5.4631 -5.1675 -4.8541 -4.5189 -4.1568 -3.7599 -3.3160 -2.8025 -2.1708 -1.2533 1.2533 2.1708 2.8025 3.3160 3.7599 4.1568 4.5189 4.8541 5.1675 5.4631 5.7434 6.0107 6.2666 6.5124

pdf of f(x)

x=linspace(-2,2,100);
f=norm_fun_pdf(x,mu,v,fun,'fun_span',5,'fun_resol',500,'dx',1e-2);
plot(x,f); ylabel 'pdf'

cdf of f(x)

F=norm_fun_cdf(x,mu,v,fun,'fun_span',5,'fun_resol',500);
plot(x,F); ylabel 'cdf'

Inverse cdf of f(x)

p=[0.5 0.75]; % median and 3rd quartile
x=norm_fun_inv(p,mu,v,fun)
x = 1×2
0.2803 0.8832

Classify in 1d

mu_1=0; v_1=1;
mu_2=2.5; v_2=1.5;
results=classify_normals([mu_1,v_1],[mu_2,v_2])
results = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [-11.2223 1.2223] norm_errmat: [2×2 double] norm_err: 0.1296 norm_dprime: 2.2565 norm_maha_dprime: 2.2361

with unequal priors and outcome values

results=classify_normals([mu_1,v_1],[mu_2,v_2],'prior_1',.7,'vals',[3 0; 0 1])
results = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [-12.0987 2.0987] norm_errmat: [2×2 double] norm_err: 0.1240 norm_valmat: [2×2 double] norm_val: 2.2509

Classify in 1d using samples

Priors are assumed prop. to sample sizes.
mu_1=0; v_1=1;
samp_1=normrnd(mu_1,sqrt(v_1),[700 1]);
mu_2=1.5; v_2=1.5;
samp_2=normrnd(mu_2,sqrt(v_2),[300 1]);
results=classify_normals(samp_1,samp_2,'input_type','samp')
Iteration Func-count min f(x) Procedure 0 1 -794 1 4 -798 initial simplex 2 5 -798 reflect 3 7 -799 reflect 4 9 -799 contract outside 5 10 -799 reflect 6 12 -800 contract inside 7 17 -800 shrink 8 19 -800 contract inside 9 24 -800 shrink 10 29 -800 shrink 11 31 -800 contract outside 12 36 -800 shrink 13 41 -800 shrink 14 46 -800 shrink 15 51 -800 shrink 16 56 -800 shrink 17 61 -800 shrink 18 66 -800 shrink 19 71 -800 shrink 20 76 -800 shrink 21 81 -800 shrink 22 86 -800 shrink 23 91 -800 shrink 24 96 -800 shrink 25 101 -800 shrink 26 106 -800 shrink 27 111 -800 shrink 28 116 -800 shrink 29 121 -800 shrink 30 126 -800 shrink 31 131 -800 shrink 32 136 -800 shrink 33 141 -800 shrink 34 146 -800 shrink 35 151 -800 shrink 36 156 -800 shrink 37 161 -800 shrink 38 166 -800 shrink 39 171 -800 shrink 40 176 -800 shrink 41 181 -800 shrink 42 186 -800 shrink 43 191 -800 shrink 44 196 -800 shrink 45 201 -800 shrink 46 206 -800 shrink 47 211 -800 shrink 48 216 -800 shrink 49 221 -800 shrink 50 226 -800 shrink 51 231 -800 shrink 52 236 -800 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 1.000000e-03
results = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [-6.3980 1.4393] norm_errmat: [2×2 double] norm_err: 0.2028 samp_errmat: [2×2 double] samp_err: 0.2060 samp_dv: {[700×1 double] [300×1 double]} samp_opt_bd: [1×1 struct] samp_opt_dv: {[700×1 double] [300×1 double]} samp_opt_bd_pts: [-6.4294 1.5450] samp_opt_errmat: [2×2 double] samp_opt_err: 0.2000

Integrate normal in 2d

in a quadratic domain

defined by (x+y)^2 > x+1, i.e.
q(x,y)= [x y]*[1 1; 1 1]*[x;y] + [-1 0]*[x;y] -1 > 0
mu=[-1; -1]; v=[1 0.5; 0.5 2];
quad.q2=[1 1; 1 1];
quad.q1=[-1;0];
quad.q0=-1;
% compare two integration algorithms
[p,pc,bd_pts]=integrate_normal(mu,v,quad) % ray method
p = 0.8214
pc = 0.1786
bd_pts = 2×504
103 ×
-0.0001 0.0021 -0.0001 0.0021 -0.0001 0.0021 -0.0001 0.0021 -0.0001 0.0021 -0.0001 0.0021 -0.0001 0.0020 -0.0001 0.0020 -0.0001 0.0019 -0.0002 0.0019 -0.0002 0.0019 -0.0002 0.0018 -0.0002 0.0018 -0.0002 0.0018 -0.0002 0.0017 -0.0002 0.0017 -0.0002 0.0017 -0.0002 0.0017 -0.0002 0.0017 -0.0002 0.0016 -0.0002 0.0015 -0.0002 0.0015 -0.0002 0.0014 -0.0002 0.0013 -0.0003 0.0013 -0.0008 -0.0003 -0.0008 -0.0003 -0.0008 -0.0003 -0.0008 -0.0003 -0.0008 -0.0003 -0.0008 -0.0003 -0.0008 -0.0003 -0.0008 -0.0003 -0.0008 -0.0002 -0.0008 -0.0002 -0.0008 -0.0002 -0.0007 -0.0001 -0.0007 -0.0001 -0.0007 -0.0001 -0.0007 -0.0001 -0.0007 -0.0001 -0.0007 -0.0001 -0.0007 -0.0001 -0.0007 -0.0000 -0.0007 0.0000 -0.0007 0.0000 -0.0007 0.0001 -0.0006 0.0001 -0.0006 0.0002 -0.0006 0.0002
axis([-6 10 -10 2])
[p,pc]=integrate_normal(mu,v,quad,'method','gx2') % gx2 method
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 1.2e-03. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy.
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 1.2e-03. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy.
p = 0.8223
pc = 0.1777
axis([-6 10 -10 2])

PAPER In a non-quadratic domain

defined by f(x,y) = x sin y - y cos x -1 > 0:
fun=@(x,y) x.*sin(y) - y.*cos(x) -1;
integrate_normal(mu,v,fun,'dom_type','fun','fun_span',3);
axis([-5 5 -5 5])

pdf of f(x,y)

x=linspace(-10,10,100);
plot(x,norm_fun_pdf(x,mu,v,fun,'dx',1e-1))

PAPER probabilities of a function x^y of a 2d normal

mu=[1;2]; v=.01*[1 1.6; 1.6 4];
fun=@(x,y) x.^y;

cdf

dx=.01; x=0:dx:3;
F=norm_fun_cdf(x,mu,v,fun,'fun_span',5,'fun_resol',500);
plot(x,F); xlabel x^y; ylabel 'cdf'

pdf

f=norm_fun_pdf(x,mu,v,fun,'fun_span',5,'fun_resol',500,'dx',1e-2);
plot(x,f); xlabel x^y; ylabel 'pdf'
Verify that pdf sums to 1:
sum(f)*dx
ans = 1.0000

Mean of x^y

m=sum(x.*f)*dx
m = 1.0266

sd of x^y

m2=sum(x.^2.*f)*dx;
sd=sqrt(m2-m^2)
sd = 0.2115

median of x^y

norm_fun_inv(.5,mu,v,fun)
ans = 1.0000

Integrate joint pdf of functions of a normal

% (x,y) is a normal vector with these parameters:
mu=[6;-19];
v=[1 -.7; -.7 2];
% functions of the normal vector
fun1=@(x,y) cos(4*x);
fun2=@(x,y) cos(4*y);
% p(cos 4x > 0)
integrate_normal(mu,v,fun1,'dom_type','fun','fun_span',3);
axis image; axis([2 10 -27 -11])
% p(cos 4y > 0)
integrate_normal(mu,v,fun2,'dom_type','fun','fun_span',3);
axis image; axis([2 10 -27 -11])
Probability that cos(4x) and cos(4y) are both > 0, i.e. integrate the normal in the domain \min (\cos 4x, \cos 4y)>0:
fun3=@(x,y) min(fun1(x,y),fun2(x,y));
p=integrate_normal(mu,v,fun3,'dom_type','fun','fun_span',3)
p = 0.2495
axis image; axis([2 10 -27 -11])
Probability that cos(4x) + cos(4y) > 0.5, i.e. integrate the normal in the domain cos(4x) + cos(4y) + 0.5 > 0
fun4=@(x,y) fun1(x,y)+fun2(x,y)-0.5;
p=integrate_normal(mu,v,fun4,'dom_type','fun','fun_span',3)
p = 0.3072
axis image; axis([2 10 -27 -11]);
Percentage points (inverse cdf):
p=[0.5 0.75];
x=norm_fun_inv(p,mu,v,fun4)
x = 1×2
-0.4999 0.2210

Classify two 2d normals, one inside the other

mu_1=[4; 5]; v_1=[2 1; 1 1];
mu_2=mu_1; v_2=3*[2 -1; -1 1];
% compare two integration algorithms
results_ray=classify_normals([mu_1,v_1],[mu_2,v_2]) % ray method
results_ray = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [2×414 double] norm_errmat: [2×2 double] norm_err: 0.1979 norm_dprime: 1.6982 norm_maha_dprime: 0
axis([-2 8 0 10])
results_gx2=classify_normals([mu_1,v_1],[mu_2,v_2],'method','gx2') % gx2 method
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 1.7e-06. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy.
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 1.7e-06. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy.
results_gx2 = struct with fields:
norm_bd: [1×1 struct] norm_errmat: [2×2 double] norm_err: 0.1979 norm_dprime: 1.6982 norm_maha_dprime: 0
axis([-2 8 0 10])

PAPER Classify in 2d with custom boundaries and from samples

mu_1=[2;4]; v_1=[1 1.5; 1.5 3];
mu_2=[5;0]; v_2=[3 0; 0 1];
% ray method
results_ray=classify_normals([mu_1,v_1],[mu_2,v_2]);
axis image; axis([-10 10 -10 10])
results_ray.norm_err
ans = 0.0079
% compare with generalized chi square method
results_gx2=classify_normals([mu_1,v_1],[mu_2,v_2],'method','gx2');
axis image; axis([-10 10 -10 10])
results_gx2.norm_err
ans = 0.0079
% now supply a custom linear boundary
linear_bd.q2=zeros(2);
linear_bd.q1=[-.7;1];
linear_bd.q0=0;
results_linear=classify_normals([mu_1,v_1],[mu_2,v_2],'dom',linear_bd)
results_linear = struct with fields:
norm_bd_pts: [2×300 double] norm_errmat: [2×2 double] norm_err: 0.0133
axis image; axis([-10 10 -10 10])
% now classify using samples
n_samp=1e3;
samp_1=mvnrnd(mu_1,v_1,n_samp);
samp_2=mvnrnd(mu_2,v_2,n_samp);
results_samp=classify_normals(samp_1,samp_2,'input_type','samp')
Iteration Func-count min f(x) Procedure 0 1 -1985 1 7 -1985 initial simplex 2 9 -1985 contract inside 3 11 -1985 contract outside 4 19 -1985 shrink 5 27 -1985 shrink 6 35 -1985 shrink 7 43 -1985 shrink 8 51 -1985 shrink 9 59 -1985 shrink 10 67 -1985 shrink 11 75 -1985 shrink 12 83 -1985 shrink 13 91 -1985 shrink 14 99 -1985 shrink 15 107 -1985 shrink 16 115 -1985 shrink 17 123 -1985 shrink 18 131 -1985 shrink 19 139 -1985 shrink 20 147 -1985 shrink 21 155 -1985 shrink 22 163 -1985 shrink 23 171 -1985 shrink 24 179 -1985 shrink 25 187 -1985 shrink 26 195 -1985 shrink 27 203 -1985 shrink 28 211 -1985 shrink 29 219 -1985 shrink 30 227 -1985 shrink 31 235 -1985 shrink 32 243 -1985 shrink 33 251 -1985 shrink 34 259 -1985 shrink 35 267 -1985 shrink 36 275 -1985 shrink 37 283 -1985 shrink 38 291 -1985 shrink 39 299 -1985 shrink 40 307 -1985 shrink 41 315 -1985 shrink 42 323 -1985 shrink 43 331 -1985 shrink 44 339 -1985 shrink 45 347 -1985 shrink 46 355 -1985 shrink 47 363 -1985 shrink 48 371 -1985 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-04
results_samp = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [2×508 double] norm_errmat: [2×2 double] norm_err: 0.0077 norm_dprime: 4.8496 norm_maha_dprime: 4.4594 samp_errmat: [2×2 double] samp_err: 0.0075 samp_dprime: 4.8648 samp_dv: {[1000×1 double] [1000×1 double]} samp_opt_bd: [1×1 struct] samp_opt_dv: {[1000×1 double] [1000×1 double]} samp_opt_bd_pts: [2×31650 double] samp_opt_errmat: [2×2 double] samp_opt_err: 0.0075 samp_opt_dprime: 4.8648
axis image; axis([-10 10 -10 10])
% modify the sample-optimized boundary and classify with it
custom_bd=results_samp.samp_opt_bd;
custom_bd.q2=custom_bd.q2+.1;
custom_bd.q1=custom_bd.q1-2.5;
custom_bd.q0=custom_bd.q0+5;
results_samp_custom=classify_normals(samp_1,samp_2,'input_type','samp','dom',custom_bd)
Iteration Func-count min f(x) Procedure 0 1 -1946 1 7 -1960 initial simplex 2 8 -1960 reflect 3 10 -1975 expand 4 11 -1975 reflect 5 12 -1975 reflect 6 14 -1980 expand 7 15 -1980 reflect 8 17 -1981 reflect 9 18 -1981 reflect 10 19 -1981 reflect 11 20 -1981 reflect 12 22 -1981 contract outside 13 30 -1981 shrink 14 38 -1981 shrink 15 40 -1981 contract outside 16 48 -1981 shrink 17 50 -1982 reflect 18 58 -1982 shrink 19 66 -1982 shrink 20 74 -1982 shrink 21 75 -1982 reflect 22 77 -1982 contract inside 23 78 -1982 reflect 24 80 -1982 contract outside 25 88 -1982 shrink 26 96 -1982 shrink 27 104 -1982 shrink 28 112 -1982 shrink 29 120 -1982 shrink 30 128 -1982 shrink 31 136 -1982 shrink 32 144 -1982 shrink 33 152 -1982 shrink 34 160 -1982 shrink 35 168 -1982 shrink 36 176 -1982 shrink 37 184 -1982 shrink 38 192 -1982 shrink 39 200 -1982 shrink 40 208 -1982 shrink 41 216 -1982 shrink 42 224 -1982 shrink 43 232 -1982 shrink 44 240 -1982 shrink 45 248 -1982 shrink 46 256 -1982 shrink 47 264 -1982 shrink 48 272 -1982 shrink 49 280 -1982 shrink 50 288 -1982 shrink 51 296 -1982 shrink 52 304 -1982 shrink 53 312 -1982 shrink 54 320 -1982 shrink 55 328 -1982 shrink 56 336 -1982 shrink 57 344 -1982 shrink 58 352 -1982 shrink 59 360 -1982 shrink 60 368 -1982 shrink 61 376 -1982 shrink 62 384 -1982 shrink 63 392 -1982 shrink 64 400 -1982 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-04
results_samp_custom = struct with fields:
norm_bd_pts: [2×414 double] norm_errmat: [2×2 double] norm_err: 0.0225 samp_errmat: [2×2 double] samp_err: 0.0270 samp_dv: {[1000×1 double] [1000×1 double]} samp_opt_bd: [1×1 struct] samp_opt_dv: {[1000×1 double] [1000×1 double]} samp_opt_bd_pts: [2×26576 double] samp_opt_errmat: [2×2 double] samp_opt_err: 0.0090
axis image; axis([-10 10 -10 10])

PAPER Classify in 2d with non-normal samples

n_samp=1e3;
samp_1=exp(mvnrnd([0 0],eye(2),n_samp));
samp_2=-exp(mvnrnd([1 1],eye(2),n_samp))+[2 2];
results=classify_normals(samp_1,samp_2,'input_type','samp')
Iteration Func-count min f(x) Procedure 0 1 -1477 1 7 -1481 initial simplex 2 9 -1490 expand 3 10 -1490 reflect 4 11 -1490 reflect 5 13 -1495 expand 6 14 -1495 reflect 7 16 -1513 expand 8 17 -1513 reflect 9 19 -1529 expand 10 20 -1529 reflect 11 22 -1556 expand 12 23 -1556 reflect 13 25 -1607 expand 14 26 -1607 reflect 15 28 -1666 expand 16 29 -1666 reflect 17 31 -1727 expand 18 32 -1727 reflect 19 34 -1730 reflect 20 35 -1730 reflect 21 36 -1730 reflect 22 38 -1730 contract inside 23 40 -1730 contract inside 24 42 -1730 contract outside 25 44 -1730 contract inside 26 46 -1730 contract inside 27 48 -1730 contract inside 28 50 -1731 contract inside 29 52 -1731 contract outside 30 54 -1736 contract inside 31 56 -1736 contract outside 32 58 -1736 contract inside 33 60 -1736 contract inside 34 62 -1737 contract inside 35 64 -1741 reflect 36 66 -1741 contract inside 37 67 -1741 reflect 38 69 -1741 contract inside 39 70 -1741 reflect 40 71 -1741 reflect 41 73 -1741 contract outside 42 75 -1741 contract inside 43 76 -1741 reflect 44 77 -1741 reflect 45 79 -1742 reflect 46 80 -1742 reflect 47 82 -1743 reflect 48 83 -1743 reflect 49 85 -1743 contract inside 50 86 -1743 reflect 51 88 -1745 reflect 52 90 -1745 contract inside 53 92 -1748 expand 54 93 -1748 reflect 55 95 -1748 contract inside 56 96 -1748 reflect 57 98 -1748 contract outside 58 100 -1753 expand 59 101 -1753 reflect 60 102 -1753 reflect 61 103 -1753 reflect 62 105 -1755 expand 63 107 -1758 reflect 64 108 -1758 reflect 65 109 -1758 reflect 66 111 -1759 reflect 67 112 -1759 reflect 68 114 -1761 reflect 69 115 -1761 reflect 70 117 -1761 contract inside 71 125 -1761 shrink 72 126 -1761 reflect 73 134 -1761 shrink 74 135 -1761 reflect 75 143 -1761 shrink 76 151 -1762 shrink 77 153 -1762 contract outside 78 161 -1762 shrink 79 162 -1762 reflect 80 163 -1762 reflect 81 164 -1762 reflect 82 165 -1762 reflect 83 173 -1762 shrink 84 175 -1762 contract outside 85 177 -1762 contract inside 86 185 -1762 shrink 87 193 -1762 shrink 88 201 -1762 shrink 89 209 -1762 shrink 90 217 -1762 shrink 91 225 -1762 shrink 92 233 -1762 shrink 93 241 -1762 shrink 94 249 -1762 shrink 95 257 -1762 shrink 96 265 -1762 shrink 97 273 -1762 shrink 98 281 -1762 shrink 99 289 -1762 shrink 100 297 -1762 shrink 101 305 -1762 shrink 102 313 -1762 shrink 103 321 -1762 shrink 104 329 -1762 shrink 105 337 -1762 shrink 106 345 -1762 shrink 107 353 -1762 shrink 108 361 -1762 shrink 109 369 -1762 shrink 110 377 -1762 shrink 111 385 -1762 shrink 112 393 -1762 shrink 113 401 -1762 shrink 114 409 -1762 shrink 115 417 -1762 shrink 116 425 -1762 shrink 117 433 -1762 shrink 118 441 -1762 shrink 119 449 -1762 shrink 120 457 -1762 shrink 121 465 -1762 shrink 122 473 -1762 shrink 123 481 -1762 shrink 124 489 -1762 shrink 125 497 -1762 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-04
results = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [2×482 double] norm_errmat: [2×2 double] norm_err: 0.1253 norm_dprime: 2.2980 norm_maha_dprime: 1.3247 samp_errmat: [2×2 double] samp_err: 0.2615 samp_dprime: 1.2775 samp_dv: {[1000×1 double] [1000×1 double]} samp_opt_bd: [1×1 struct] samp_opt_dv: {[1000×1 double] [1000×1 double]} samp_opt_bd_pts: [2×29246 double] samp_opt_errmat: [2×2 double] samp_opt_err: 0.1190 samp_opt_dprime: 2.3600
axis image; axis([-20 15 -20 15])

Inversion/union/intersection of integration/classification domains

mu=[0;0]; v=[.5 0; 0 1];
circle_left=@(x,y) -(x+1).^2-y.^2+5;
circle_right=@(x,y) -(x-1).^2-y.^2+5;
circle_union=@(x,y) max(circle_left(x,y), circle_right(x,y));
p=integrate_normal(mu,v,circle_union,'dom_type','fun','fun_span',5)
p = 0.9680
axis image; axis([-4 4 -4 4])
circle_intersection=@(x,y) min(circle_left(x,y), circle_right(x,y));
p=integrate_normal(mu,v,circle_intersection,'dom_type','fun','fun_span',5)
p = 0.7949
axis image; axis([-4 4 -4 4])
crescent=@(x,y) max(circle_left(x,y), -circle_right(x,y));
p=integrate_normal(mu,v,crescent,'dom_type','fun','fun_span',5)
p = 0.9136
axis image; axis([-4 4 -4 4])
% classify normals using this crescent domain
mu_2=[2.2;0]; v_2=[.5 0; 0 .25];
results=classify_normals([mu,v],[mu_2,v_2],'dom',crescent,'dom_type','fun')
results = struct with fields:
norm_bd_pts: [2×586 double] norm_errmat: [2×2 double] norm_err: 0.1235
axis image; axis([-2 4 -3 3])

Classify in 3d

mu_1=[0;0;0]; v_1=eye(3);
mu_2=[2;1;1]; v_2=2*eye(3);
results=classify_normals([mu_1,v_1],[mu_2,v_2])
results = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [3×11936 double] norm_errmat: [2×2 double] norm_err: 0.1390 norm_dprime: 2.1694 norm_maha_dprime: 2

Estimate tiny errors (large d') with high accuracy

format long
dprime_true=75
dprime_true =
75
mu_1=[0;0;0]; v=eye(3);
mu_2=dprime_true*[1;0;0];
results=classify_normals([mu_1,v],[mu_2,v],'AbsTol',0,'RelTol',1e-2)
results = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [3×14112 double] norm_errmat: [2×2 double] norm_err: 4.608155172364448e-308 norm_dprime: 74.999967581801229 norm_maha_dprime: 75
axis image; axis([-5 80 -2 2 -2 2]); view(-53,25)
dprime_computed=results.norm_dprime
dprime_computed =
74.999967581801229
format

PAPER accuracy vs separation between the normals

mu_1=[0;0;0];
% both normals have the same covariance, so we can check against
% the true d' (Mahalanobis distance).
v=[1 .5 .7;
.5 2 1 ;
.7 1 3];
steps=linspace(1,100,10);
d_true=nan(size(steps));
d_gx2=nan(size(steps));
d_ray=nan(size(steps));
parfor i=1:length(steps)
i
mu_2=steps(i)*[1;1;1];
results_gx2=classify_normals([mu_1,v],[mu_2,v],'method','gx2','AbsTol',0,'RelTol',0,'plotmode',false);
d_true(i)=results_gx2.norm_maha_dprime;
d_gx2(i)=results_gx2.norm_dprime;
results_ray=classify_normals([mu_1,v],[mu_2,v],'method','ray','AbsTol',0,'RelTol',0,'plotmode',false);
d_ray(i)=results_ray.norm_dprime;
end
Starting parallel pool (parpool) using the 'local' profile ... Connected to the parallel pool (number of workers: 4). ans = 1 ans = 2 ans = 3 ans = 4 Warning: Integrand function outputs did not match to the required tolerance when the same input values were supplied in two separate calls with different size input matrices. Check that the function is vectorized properly. > In integral2Calc>integral2t/tensor (line 247) In integral2Calc>integral2t (line 55) In integral2Calc (line 9) In integral2 (line 106) In int_norm_ray (line 45) In integrate_normal (line 85) In classify_normals (line 191) In parallel_function>make_general_channel/channel_general (line 832) In remoteParallelFunction (line 67) Warning: Integrand function outputs did not match to the required tolerance when the same input values were supplied in two separate calls with different size input matrices. Check that the function is vectorized properly. > In integral2Calc>integral2t/tensor (line 247) In integral2Calc>integral2t (line 55) In integral2Calc (line 9) In integral2 (line 106) In int_norm_ray (line 44) In integrate_normal (line 85) In classify_normals (line 193) In parallel_function>make_general_channel/channel_general (line 832) In remoteParallelFunction (line 67) ans = 10 ans = 9 ans = 8 ans = 7 ans = 6 ans = 5 Warning: Integrand function outputs did not match to the required tolerance when the same input values were supplied in two separate calls with different size input matrices. Check that the function is vectorized properly. > In integral2Calc>integral2t/tensor (line 247) In integral2Calc>integral2t (line 55) In integral2Calc (line 9) In integral2 (line 106) In int_norm_ray (line 45) In integrate_normal (line 85) In classify_normals (line 191) In parallel_function>make_general_channel/channel_general (line 832) In remoteParallelFunction (line 67) Warning: Integrand function outputs did not match to the required tolerance when the same input values were supplied in two separate calls with different size input matrices. Check that the function is vectorized properly. > In integral2Calc>integral2t/tensor (line 247) In integral2Calc>integral2t (line 55) In integral2Calc (line 9) In integral2 (line 106) In int_norm_ray (line 44) In integrate_normal (line 85) In classify_normals (line 193) In parallel_function>make_general_channel/channel_general (line 832) In remoteParallelFunction (line 67)
rel_err_gx2=abs(d_gx2-d_true)./d_true;
rel_err_ray=abs(d_ray-d_true)./d_true;
figure; hold on
plot(d_true,rel_err_gx2,'-o')
plot(d_true,rel_err_ray,'-o')
xline(-2*norminv(realmin)) % largest computable d', corr. to the smallest possible error representable in double-precision
yline(eps) % machine epsilon for double precision
xlim([1 80]); ylim([0 2.2e-15])
xlabel 'true d'''
ylabel('$\epsilon$','interpreter','latex')
legend({'$\tilde{\chi}^2$','ray'},'interpreter','latex')

PAPER Integrate normal in a torus defined by function f(x)>0

mu=[0;0;0];
v=[1 0 0;
0 8 4;
0 4 8];
% plot the error ellipsoid of the normal
figure; plot_normal(mu,v);
fun_torus=@(x1,x2,x3) 1.5-(5-(x1.^2+x2.^2).^0.5).^2-x3.^2;
integrate_normal(mu,v,fun_torus,'dom_type','fun','fun_span',3,'fun_resol',10,'RelTol',1e-1);
axis image; axis([-7 7 -7 7 -7 7])

Plot the pdf and cdf of f(x)

x=[linspace(-80,-20,30) linspace(-20,10,20)];
f=norm_fun_pdf(x,mu,v,fun_torus,'fun_span',3,'fun_resol',10,'RelTol',1e-1,'dx',8);
plot(x,f)
p=norm_fun_cdf(x,mu,v,fun_torus,'fun_span',3,'fun_resol',10,'RelTol',1e-1);
plot(x,p)

PAPER Integrate normal in 4d

outside the sphere of radius 5, i.e. x1^2+x2^2+x3^2+x4^2>5^2, i.e. x'*eye(4)*x + zeros(4,1)'*x -25 >0
mu=[1;1;1;1]; v=diag([1 2 3 4]);
quad.q2=eye(4);
quad.q1=zeros(4,1);
quad.q0=-25;
p=integrate_normal(mu,v,quad)
p = 0.1276
axis([-30 40 0 .06]);

PAPER Classify in 4d, with priors and outcome values

mu_1=[0;0;0;0]; v_1=eye(4);
mu_2=[1;1;1;1]; v_2=eye(4);
% here the Bayes decision variable is normally distributed
results=classify_normals([mu_1,v_1],[mu_2,v_2],'prior_1',.7,'vals',[2 0; 0 1])
results = struct with fields:
norm_bd: [1×1 struct] norm_errmat: [2×2 double] norm_err: 0.1496 norm_valmat: [2×2 double] norm_val: 1.5236
mu_1=[0;0;0;0];
v_1=[1 0 0 0;
0 2 -1 0;
0 -1 3 2;
0 0 2 4];
mu_2=1.5*[1;1;1;1];
v_2=[2 0 0 0;
0 2 0 0;
0 0 2 0;
0 0 0 1];
% correct classification of class 1 is valued 4x than class 2
% here the Bayes decision variable is distributed as a generalized chi-square
results=classify_normals([mu_1,v_1],[mu_2,v_2],'prior_1',.7,'vals',[4 0; 0 1])
results = struct with fields:
norm_bd: [1×1 struct] norm_errmat: [2×2 double] norm_err: 0.1302 norm_valmat: [2×2 double] norm_val: 2.9431
% use ray method (with Monte Carlo integration)
results=classify_normals([mu_1,v_1],[mu_2,v_2],'prior_1',.7,'vals',[4 0; 0 1],'method','ray','mc_samples',1e3)
results = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [4×2432 double] norm_errmat: [2×2 double] norm_err: 0.1284 norm_valmat: [2×2 double] norm_val: 2.9470
% now classify using samples
n_samp=1e3;
results=classify_normals(mvnrnd(mu_1',v_1,n_samp),mvnrnd(mu_2',v_2,n_samp),'input_type','samp','prior_1',.7,'vals',[4 0; 0 1])
Iteration Func-count min f(x) Procedure 0 1 -4547 1 16 -4560 initial simplex 2 18 -4577 reflect 3 19 -4577 reflect 4 20 -4577 reflect 5 21 -4577 reflect 6 22 -4577 reflect 7 23 -4577 reflect 8 24 -4577 reflect 9 25 -4577 reflect 10 26 -4577 reflect 11 27 -4577 reflect 12 28 -4577 reflect 13 29 -4577 reflect 14 30 -4577 reflect 15 31 -4577 reflect 16 33 -4581 expand 17 34 -4581 reflect 18 36 -4583 reflect 19 37 -4583 reflect 20 38 -4583 reflect 21 39 -4583 reflect 22 40 -4583 reflect 23 41 -4583 reflect 24 42 -4583 reflect 25 43 -4583 reflect 26 44 -4583 reflect 27 45 -4583 reflect 28 47 -4585 reflect 29 48 -4585 reflect 30 49 -4585 reflect 31 50 -4585 reflect 32 51 -4585 reflect 33 53 -4585 contract inside 34 54 -4585 reflect 35 55 -4585 reflect 36 72 -4585 shrink 37 73 -4585 reflect 38 74 -4585 reflect 39 75 -4585 reflect 40 77 -4585 contract inside 41 78 -4585 reflect 42 79 -4585 reflect 43 80 -4585 reflect 44 82 -4585 contract inside 45 84 -4585 contract inside 46 86 -4585 contract inside 47 88 -4585 contract inside 48 90 -4587 reflect 49 92 -4587 contract inside 50 94 -4587 contract inside 51 96 -4587 contract inside 52 97 -4587 reflect 53 99 -4587 contract inside 54 100 -4587 reflect 55 101 -4587 reflect 56 103 -4587 contract inside 57 105 -4587 contract inside 58 106 -4587 reflect 59 107 -4587 reflect 60 109 -4587 contract inside 61 111 -4587 contract inside 62 113 -4588 reflect 63 115 -4588 contract inside 64 117 -4588 contract inside 65 118 -4588 reflect 66 119 -4588 reflect 67 121 -4588 contract inside 68 122 -4588 reflect 69 124 -4588 contract inside 70 125 -4588 reflect 71 127 -4588 contract inside 72 128 -4588 reflect 73 129 -4588 reflect 74 130 -4588 reflect 75 131 -4588 reflect 76 148 -4588 shrink 77 165 -4588 shrink 78 166 -4588 reflect 79 167 -4588 reflect 80 168 -4588 reflect 81 169 -4588 reflect 82 170 -4588 reflect 83 187 -4588 shrink 84 188 -4588 reflect 85 190 -4588 contract inside 86 207 -4588 shrink 87 224 -4588 shrink 88 241 -4588 shrink 89 258 -4588 shrink 90 275 -4588 shrink 91 292 -4588 shrink 92 309 -4588 shrink 93 326 -4588 shrink 94 343 -4588 shrink 95 360 -4588 shrink 96 377 -4588 shrink 97 394 -4588 shrink 98 411 -4588 shrink 99 428 -4588 shrink 100 445 -4588 shrink 101 462 -4588 shrink 102 479 -4588 shrink 103 496 -4588 shrink 104 513 -4588 shrink 105 530 -4588 shrink 106 547 -4588 shrink 107 564 -4588 shrink 108 581 -4588 shrink 109 598 -4588 shrink 110 615 -4588 shrink 111 632 -4588 shrink 112 649 -4588 shrink 113 666 -4588 shrink 114 683 -4588 shrink 115 700 -4588 shrink 116 717 -4588 shrink 117 734 -4588 shrink 118 751 -4588 shrink 119 768 -4588 shrink 120 785 -4588 shrink 121 802 -4588 shrink 122 819 -4588 shrink 123 836 -4588 shrink 124 853 -4588 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-04
results = struct with fields:
norm_bd: [1×1 struct] norm_errmat: [2×2 double] norm_err: 0.1311 norm_valmat: [2×2 double] norm_val: 2.9424 samp_errmat: [2×2 double] samp_err: 0.2145 samp_valmat: [2×2 double] samp_val: 4547 samp_dv: {[1000×1 double] [1000×1 double]} samp_opt_bd: [1×1 struct] samp_opt_dv: {[1000×1 double] [1000×1 double]} samp_opt_errmat: [2×2 double] samp_opt_err: 0.1895 samp_opt_valmat: [2×2 double] samp_opt_val: 4588

PAPER Integrate in a 4d polyhedron, using Monte Carlo

mu=zeros(4,1);
v=eye(4);
fun=@(x1,x2,x3,x4) abs(x1)+abs(x2)+abs(x3)+abs(x4);
% find p(f(x)<1)
mc_samples=round(10.^linspace(1,4,20)); % # of Monte Carlo samples
n_repeat=5;
plist=nan(length(mc_samples),n_repeat);
for k=1:n_repeat
for i=1:length(mc_samples)
[~,p]=integrate_normal(mu,v,fun,'dom_type','fun','fun_level',1,'fun_span',3,'fun_resol',10,'mc_samples',mc_samples(i),'plotmode',0);
plist(i,k)=p;
end
end
plot(mc_samples,plist,'-k','marker','.','markersize',10)
xlabel 'Monte Carlo sample size'; ylabel 'p'
set(gca,'xscale','log')
Compute cdf and pdf of the polyhedral function
x=linspace(-1,8,50);
p=norm_fun_cdf(x,mu,v,fun);
plot(x,p,'-o')
f=norm_fun_pdf(x,mu,v,fun,'dx',0.5,'mc_samples',5e3);
plot(x,f)

Classifying 3 1d normals

normals=struct;
normals(1).mu=-1; normals(1).v=1;
normals(2).mu=1; normals(2).v=2;
normals(3).mu=4; normals(3).v=.5;
% priors and outcome values
priors=[.4 .5 .1];
vals=[4 0 0; 0 1 -2; 0 0 1];
results=classify_normals_multi(normals,'priors',priors,'vals',vals)
Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3
results = struct with fields:
norm_bd_pts: {3×1 cell} norm_errmat: [3×3 double] norm_err: 0.2834 norm_valmat: [3×3 double] norm_val: 1.8466

Classifying 4 2d normals

% define struct of all normals
normals=struct;
normals(1).mu=[1;0]; normals(1).v=2*eye(2);
normals(2).mu=[0;1]; normals(2).v=eye(2);
normals(3).mu=[-1;0]; normals(3).v=eye(2);
normals(4).mu=[0;-1]; normals(4).v=eye(2);
% plot the multi-class boundary of normal 3
plot_boundary(@(n,mu,v) opt_class_multi(n,normals,3,'mu',mu,'v',v),2,'mu',normals(3).mu,'dom_type','ray_scan')
title 'boundary of normal 3'
% classify
results=classify_normals_multi(normals); axis image
Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 1 in domain 4 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 2 in domain 4 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3 Integrating normal 3 in domain 4 Integrating normal 4 in domain 1 Integrating normal 4 in domain 2 Integrating normal 4 in domain 3 Integrating normal 4 in domain 4
% now classify using samples from these normals, with outcome values
samples=struct;
for i=1:4
samples(i).sample=mvnrnd(normals(i).mu,normals(i).v,1e4);
end
vals=diag([1 2 3 4]);
results_samp=classify_normals_multi(samples,'input_type','samp','vals',vals)
Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 1 in domain 4 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 2 in domain 4 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3 Integrating normal 3 in domain 4 Integrating normal 4 in domain 1 Integrating normal 4 in domain 2 Integrating normal 4 in domain 3 Integrating normal 4 in domain 4
results_samp = struct with fields:
norm_bd_pts: {4×1 cell} norm_errmat: [4×4 double] norm_err: 0.4610 norm_valmat: [4×4 double] norm_val: 1.5608 samp_errmat: [4×4 double] samp_err: 0.4626 samp_valmat: [4×4 double] samp_val: 62324
axis image
% now classify using samples from t distributions similar to these normals
samples=struct;
for i=1:4
samples(i).sample=mvtrnd(normals(i).v,3,1e4)+normals(i).mu';
end
results_samp=classify_normals_multi(samples,'input_type','samp')
Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 1 in domain 4 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 2 in domain 4 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3 Integrating normal 3 in domain 4 Integrating normal 4 in domain 1 Integrating normal 4 in domain 2 Integrating normal 4 in domain 3 Integrating normal 4 in domain 4
results_samp = struct with fields:
norm_bd_pts: {4×1 cell} norm_errmat: [4×4 double] norm_err: 0.5709 samp_errmat: [4×4 double] samp_err: 0.4575
axis image; axis([-6 6 -6 6])

PAPER Classifying 7 2d normals

% define struct of all normals
normals=struct;
normals(1).mu=[2;0]; normals(1).v=[2 1; 1 2];
normals(2).mu=[0;1]; normals(2).v=[.5 0; 0 1];
normals(3).mu=[-1;0]; normals(3).v=[1 .3; .3 1];
normals(4).mu=[0;-1]; normals(4).v=[.5 -.5; -.5 1];
normals(5).mu=[-2;2]; normals(5).v=.5*[1 1; 1 5];
normals(6).mu=[2;-3]; normals(6).v=.3*eye(2);
normals(7).mu=[-2;-2.5]; normals(7).v=[1 0; 0 .1];
% classify
results=classify_normals_multi(normals)
Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 1 in domain 4 Integrating normal 1 in domain 5 Integrating normal 1 in domain 6 Integrating normal 1 in domain 7 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 2 in domain 4 Integrating normal 2 in domain 5 Integrating normal 2 in domain 6 Integrating normal 2 in domain 7 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3 Integrating normal 3 in domain 4 Integrating normal 3 in domain 5 Integrating normal 3 in domain 6 Integrating normal 3 in domain 7 Integrating normal 4 in domain 1 Integrating normal 4 in domain 2 Integrating normal 4 in domain 3 Integrating normal 4 in domain 4 Integrating normal 4 in domain 5 Integrating normal 4 in domain 6 Integrating normal 4 in domain 7 Integrating normal 5 in domain 1 Integrating normal 5 in domain 2 Integrating normal 5 in domain 3 Integrating normal 5 in domain 4 Integrating normal 5 in domain 5 Integrating normal 5 in domain 6 Integrating normal 5 in domain 7 Integrating normal 6 in domain 1 Integrating normal 6 in domain 2 Integrating normal 6 in domain 3 Integrating normal 6 in domain 4 Integrating normal 6 in domain 5 Integrating normal 6 in domain 6 Integrating normal 6 in domain 7 Integrating normal 7 in domain 1 Integrating normal 7 in domain 2 Integrating normal 7 in domain 3 Integrating normal 7 in domain 4 Integrating normal 7 in domain 5 Integrating normal 7 in domain 6 Integrating normal 7 in domain 7
results = struct with fields:
norm_bd_pts: {7×1 cell} norm_errmat: [7×7 double] norm_err: 0.2319
axis image; axis([-10 10 -10 10]);

Classifying 4 3d normals

normals=struct;
normals(1).mu=[1;0;0]; normals(1).v=2*eye(3);
normals(2).mu=[0;1;0]; normals(2).v=eye(3);
normals(3).mu=[-1;0;0]; normals(3).v=eye(3);
normals(4).mu=[0;-1;0]; normals(4).v=eye(3);
results=classify_normals_multi(normals)
Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 1 in domain 4 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 2 in domain 4 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3 Integrating normal 3 in domain 4 Integrating normal 4 in domain 1 Integrating normal 4 in domain 2 Integrating normal 4 in domain 3 Integrating normal 4 in domain 4
results = struct with fields:
norm_bd_pts: {4×1 cell} norm_errmat: [4×4 double] norm_err: 0.4254

PAPER Classifying 4 4d t distribution samples

params=struct;
params(1).mu=[0;-4;-2;-2]; params(1).v=diag([1 2 3 4]);
params(2).mu=[1;1;0;0]; params(2).v=eye(4)/4;
params(3).mu=[3;4;5;7]; params(3).v=eye(4);
params(4).mu=[5;5;7;4]; params(4).v=eye(4);
priors=[.3 .5 .15 .05];
n_samp=1e3;
samples=struct;
for i=1:4
samples(i).sample=mvtrnd(params(i).v,3,n_samp)+params(i).mu';
end
results_samp=classify_normals_multi(samples,'input_type','samp','priors',priors,'mc_samples',1e3,'plotmode',[1;1;1;1])
Integrating normal 1 in domain 1
Integrating normal 1 in domain 2
Integrating normal 1 in domain 3
Integrating normal 1 in domain 4
Integrating normal 2 in domain 1
Integrating normal 2 in domain 2
Integrating normal 2 in domain 3
Integrating normal 2 in domain 4
Integrating normal 3 in domain 1
Integrating normal 3 in domain 2
Integrating normal 3 in domain 3
Integrating normal 3 in domain 4
Integrating normal 4 in domain 1
Integrating normal 4 in domain 2
Integrating normal 4 in domain 3
Integrating normal 4 in domain 4
results_samp = struct with fields:
norm_bd_pts: {4×1 cell} norm_errmat: [4×4 double] norm_err: 0.0402 samp_errmat: [4×4 double] samp_err: 0.0580

PAPER testing the normal approximation for 2 2d classes

N_samp=1e4; n_samp=1e2;
mu_1=[5 5]; v_1=[1 .5; .5 1]; samp_1=mvnrnd(mu_1,v_1,N_samp).^3; % not normal
mu_2=[-200 -200]; v_2=[1 1; 1 3]*2e3; samp_2=mvnrnd(mu_2,v_2,N_samp);
results=classify_normals(samp_1,samp_2,'input_type','samp','samp_opt',false);
axis([-300 600 -400 600]); hold on
bd=results.norm_bd;
q0s=linspace(-100,35,100)';
true_p11=nan(size(q0s)); true_p2_2=nan(size(q0s)); % p(1|1)
norm_p11=nan(size(q0s)); norm_p2_2=nan(size(q0s));
for i=1:length(q0s)
bd_shift=bd; bd_shift.q0=q0s(i);
if ~rem(i,10)
plot_boundary(bd_shift,2,'plot_type','line','line_color',.5*[1 1 1]);
end
results_shift=classify_normals(samp_1,samp_2,'input_type','samp','dom',bd_shift,'samp_opt',false,'plotmode',false);
% true outcomes
true_p11(i)=results_shift.samp_errmat(1,1)/N_samp;
true_p2_2(i)=results_shift.samp_errmat(2,2)/N_samp;
% normal outcomes
norm_p11(i)=results_shift.norm_errmat(1,1)/.5;
norm_p2_2(i)=results_shift.norm_errmat(2,2)/.5;
end
true_p1_1_sd=sqrt(true_p11.*(1-true_p11)/n_samp);
true_p2_2_sd=sqrt(true_p2_2.*(1-true_p2_2)/n_samp);
norm_p1_1_sd=sqrt(norm_p11.*(1-norm_p11)/n_samp);
norm_p2_2_sd=sqrt(norm_p2_2.*(1-norm_p2_2)/n_samp);
figure; hold on
colors=colororder;
xline(bd.q0,'k','optimal boundary','LabelVerticalAlignment','bottom') % optimal criterion
% p(1|1)
x=q0s; y=true_p11; dy=true_p1_1_sd;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],colors(1,:),'facealpha',.3,'linestyle','none');
y=norm_p11; dy=norm_p1_1_sd;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],'k','facecolor','none','edgecolor',colors(1,:));
% p(2|2)
y=true_p2_2; dy=true_p2_2_sd;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],colors(2,:),'facealpha',.3,'linestyle','none');
y=norm_p2_2; dy=norm_p2_2_sd;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],'k','facecolor','none','edgecolor',colors(2,:));
xlim([min(q0s) max(q0s)]); ylim([-.01 1.01]); xlabel('boundary offset q_0')

PAPER testing the normal approximation for 4 4d t distributions

n_class=4; N_samp=1e4; n_samp=1e2;
% t distribution parameters
params_t=struct;
params_t(1).mu=[0;-4;-2;-2]; params_t(1).v=diag([1 2 3 4]);
params_t(2).mu=[1;1;0;0]; params_t(2).v=eye(4)/4;
params_t(3).mu=[3;4;5;7]; params_t(3).v=eye(4);
params_t(4).mu=[5;5;7;4]; params_t(4).v=eye(4);
samples=struct; params_samp=struct;
for i=1:4
% generate t samples
sample=mvtrnd(params_t(i).v,3,N_samp)+params_t(i).mu';
samples(i).sample=sample;
% mean and covariance of samples
params_samp(i).mu=mean(sample)';
params_samp(i).v=cov(sample)';
end
len_fam=10;
prior_fam=10.^linspace(-6,12,len_fam)';
vscale_fam=10.^linspace(-1,3,len_fam)';
true_p22_mean=nan(len_fam,1);
true_pe_mean=nan(len_fam,1);
true_pe_sd=nan(len_fam,1);
norm_p22_mean=nan(len_fam,1);
norm_pe_mean=nan(len_fam,1);
norm_pe_sd=nan(len_fam,1);
parfor i=1:len_fam
i
% generate family of classification domains
% uncomment when varying prior, comment when varying variance
priors_shift=[1 prior_fam(i) 1 1]; priors_shift=priors_shift/sum(priors_shift);
domains_shift=cell(n_class,1);
for k=1:n_class
domains_shift{k}=@(n,mu,v) opt_class_multi(n,params_samp,k,'mu',mu,'v',v,'priors',priors_shift);
end
% uncomment when varying variance, comment when varying prior
% params_samp_shift=params_samp;
% for k=1:n_class
% params_samp_shift(k).v=vscale_fam(i)*params_samp(k).v;
% end
% domains_shift=cell(n_class,1);
% for k=1:n_class
% domains_shift{k}=@(n,mu,v) opt_class_multi(n,params_samp_shift,k,'mu',mu,'v',v);
% end
results_shift=classify_normals_multi(samples,'input_type','samp','doms',domains_shift,'mc_samples',5e3,'plotmode',false);
% true error rates
true_p22_mean(i)=results_shift.samp_errmat(2,2)/N_samp;
true_pe_mean(i)=results_shift.samp_err;
samp_errmat_p=results_shift.samp_errmat/(n_class*N_samp);
errs=sum(~eye(length(samples)).*samp_errmat_p,2);
accs=diag(samp_errmat_p);
true_pe_sd(i)=sqrt(sum(errs.*accs)/n_samp);
% normal error rates
norm_p22_mean(i)=results_shift.norm_errmat(2,2)/sum(results_shift.norm_errmat(2,:));
norm_pe_mean(i)=results_shift.norm_err;
errs=sum(~eye(length(samples)).*results_shift.norm_errmat,2);
accs=diag(results_shift.norm_errmat);
norm_pe_sd(i)=sqrt(sum(errs.*accs)/n_samp);
end
ans = 1 ans = 2 ans = 3 ans = 4 Integrating normal 1 in domain 1 Integrating normal 1 in domain 1 Integrating normal 1 in domain 1 Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 2 Integrating normal 1 in domain 2 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 1 in domain 3 Integrating normal 1 in domain 3 Integrating normal 1 in domain 3 Integrating normal 1 in domain 4 Integrating normal 1 in domain 4 Integrating normal 1 in domain 4 Integrating normal 1 in domain 4 Integrating normal 2 in domain 1 Integrating normal 2 in domain 1 Integrating normal 2 in domain 1 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 2 Integrating normal 2 in domain 2 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 2 in domain 3 Integrating normal 2 in domain 3 Integrating normal 2 in domain 3 Integrating normal 2 in domain 4 Integrating normal 2 in domain 4 Integrating normal 2 in domain 4 Integrating normal 2 in domain 4 Integrating normal 3 in domain 1 Integrating normal 3 in domain 1 Integrating normal 3 in domain 1 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 2 Integrating normal 3 in domain 2 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3 Integrating normal 3 in domain 3 Integrating normal 3 in domain 3 Integrating normal 3 in domain 3 Integrating normal 3 in domain 4 Integrating normal 3 in domain 4 Integrating normal 3 in domain 4 Integrating normal 3 in domain 4 Integrating normal 4 in domain 1 Integrating normal 4 in domain 1 Integrating normal 4 in domain 1 Integrating normal 4 in domain 1 Integrating normal 4 in domain 2 Integrating normal 4 in domain 2 Integrating normal 4 in domain 2 Integrating normal 4 in domain 2 Integrating normal 4 in domain 3 Integrating normal 4 in domain 3 Integrating normal 4 in domain 3 Integrating normal 4 in domain 3 Integrating normal 4 in domain 4 Integrating normal 4 in domain 4 Integrating normal 4 in domain 4 Integrating normal 4 in domain 4 ans = 6 Integrating normal 1 in domain 1 ans = 10 Integrating normal 1 in domain 1 ans = 5 Integrating normal 1 in domain 1 ans = 8 Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 2 Integrating normal 1 in domain 2 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 1 in domain 3 Integrating normal 1 in domain 3 Integrating normal 1 in domain 3 Integrating normal 1 in domain 4 Integrating normal 1 in domain 4 Integrating normal 1 in domain 4 Integrating normal 1 in domain 4 Integrating normal 2 in domain 1 Integrating normal 2 in domain 1 Integrating normal 2 in domain 1 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 2 Integrating normal 2 in domain 2 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 2 in domain 3 Integrating normal 2 in domain 3 Integrating normal 2 in domain 3 Integrating normal 2 in domain 4 Integrating normal 2 in domain 4 Integrating normal 2 in domain 4 Integrating normal 2 in domain 4 Integrating normal 3 in domain 1 Integrating normal 3 in domain 1 Integrating normal 3 in domain 1 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 2 Integrating normal 3 in domain 2 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3 Integrating normal 3 in domain 3 Integrating normal 3 in domain 3 Integrating normal 3 in domain 3 Integrating normal 3 in domain 4 Integrating normal 3 in domain 4 Integrating normal 3 in domain 4 Integrating normal 3 in domain 4 Integrating normal 4 in domain 1 Integrating normal 4 in domain 1 Integrating normal 4 in domain 1 Integrating normal 4 in domain 1 Integrating normal 4 in domain 2 Integrating normal 4 in domain 2 Integrating normal 4 in domain 2 Integrating normal 4 in domain 2 Integrating normal 4 in domain 3 Integrating normal 4 in domain 3 Integrating normal 4 in domain 3 Integrating normal 4 in domain 3 Integrating normal 4 in domain 4 Integrating normal 4 in domain 4 Integrating normal 4 in domain 4 Integrating normal 4 in domain 4 ans = 7 Integrating normal 1 in domain 1 ans = 9 Integrating normal 1 in domain 1 Integrating normal 1 in domain 2 Integrating normal 1 in domain 2 Integrating normal 1 in domain 3 Integrating normal 1 in domain 3 Integrating normal 1 in domain 4 Integrating normal 1 in domain 4 Integrating normal 2 in domain 1 Integrating normal 2 in domain 1 Integrating normal 2 in domain 2 Integrating normal 2 in domain 2 Integrating normal 2 in domain 3 Integrating normal 2 in domain 3 Integrating normal 2 in domain 4 Integrating normal 2 in domain 4 Integrating normal 3 in domain 1 Integrating normal 3 in domain 1 Integrating normal 3 in domain 2 Integrating normal 3 in domain 2 Integrating normal 3 in domain 3 Integrating normal 3 in domain 3 Integrating normal 3 in domain 4 Integrating normal 3 in domain 4 Integrating normal 4 in domain 1 Integrating normal 4 in domain 1 Integrating normal 4 in domain 2 Integrating normal 4 in domain 2 Integrating normal 4 in domain 3 Integrating normal 4 in domain 3 Integrating normal 4 in domain 4 Integrating normal 4 in domain 4
true_p22_sd=sqrt(true_p22_mean.*(1-true_p22_mean)/n_samp);
norm_p22_sd=sqrt(norm_p22_mean.*(1-norm_p22_mean)/n_samp);
figure; hold on;
% uncomment when varying prior, comment when varying variance
xline(1/3,'k','optimal boundary','LabelVerticalAlignment','bottom')
xlabel('assumed prior ratio p_1/(p_2+p_3+p_4)')
x=prior_fam/3;
% uncomment when varying variance, comment when varying prior
% xline(1,'k','optimal boundary','LabelVerticalAlignment','bottom')
% xlabel('assumed variance scale')
% x=vscale_fam;
% p(2|2)
y=true_p22_mean; dy=true_p22_sd;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],[0.9290 0.6940 0.1250],'facealpha',.3,'linestyle','none');
y=norm_p22_mean; dy=norm_p22_sd;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],'k','facecolor','none','edgecolor',[0.9290 0.6940 0.1250]);
% pe
y=true_pe_mean; dy=true_pe_sd;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],[0.6 0.4 0.2],'facealpha',.3,'linestyle','none');
y=norm_pe_mean; dy=norm_pe_sd;
fill([x;flipud(x)],[y-dy;flipud(y+dy)],'k','facecolor','none','edgecolor',[0.6 0.4 0.2]);
xlim([min(x) max(x)]); set(gca,'xscale','log'); ylim([-.01 1.01])

PAPER Actual vision research data: detecting targets on natural scenes

absent=importdata('target_absent.txt',',',1);
present=importdata('target_present.txt',',',1);
results=classify_normals(absent.data,present.data,'input_type','samp')
Iteration Func-count min f(x) Procedure 0 1 -4569 1 11 -4579 initial simplex 2 13 -4582 expand 3 14 -4582 reflect 4 15 -4582 reflect 5 16 -4582 reflect 6 17 -4582 reflect 7 19 -4583 reflect 8 20 -4583 reflect 9 21 -4583 reflect 10 23 -4585 reflect 11 24 -4585 reflect 12 25 -4585 reflect 13 27 -4586 reflect 14 28 -4586 reflect 15 29 -4586 reflect 16 41 -4586 shrink 17 42 -4586 reflect 18 44 -4586 contract inside 19 46 -4586 contract inside 20 48 -4586 contract inside 21 50 -4586 contract inside 22 52 -4586 contract inside 23 53 -4586 reflect 24 54 -4586 reflect 25 56 -4586 contract inside 26 68 -4587 shrink 27 70 -4587 contract inside 28 72 -4588 contract inside 29 73 -4588 reflect 30 74 -4588 reflect 31 86 -4588 shrink 32 98 -4588 shrink 33 99 -4588 reflect 34 100 -4588 reflect 35 101 -4588 reflect 36 102 -4588 reflect 37 114 -4588 shrink 38 116 -4588 contract outside 39 128 -4588 shrink 40 130 -4588 contract inside 41 142 -4588 shrink 42 154 -4588 shrink 43 166 -4588 shrink 44 178 -4588 shrink 45 190 -4588 shrink 46 202 -4588 shrink 47 214 -4588 shrink 48 226 -4588 shrink 49 238 -4588 shrink 50 250 -4588 shrink 51 262 -4588 shrink 52 274 -4588 shrink 53 286 -4588 shrink 54 298 -4588 shrink 55 310 -4588 shrink 56 322 -4588 shrink 57 334 -4588 shrink 58 346 -4588 shrink 59 358 -4588 shrink 60 370 -4588 shrink 61 382 -4588 shrink 62 394 -4588 shrink 63 406 -4588 shrink 64 418 -4588 shrink 65 430 -4588 shrink 66 442 -4588 shrink 67 454 -4588 shrink 68 466 -4588 shrink 69 478 -4588 shrink 70 490 -4588 shrink 71 502 -4588 shrink 72 514 -4588 shrink 73 526 -4588 shrink 74 538 -4588 shrink 75 550 -4588 shrink 76 562 -4588 shrink 77 574 -4588 shrink 78 586 -4588 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 2.173913e-04
results = struct with fields:
norm_bd: [1×1 struct] norm_bd_pts: [3×3754 double] norm_errmat: [2×2 double] norm_err: 8.0400e-05 norm_dprime: 7.5475 norm_maha_dprime: 6.8175 samp_errmat: [2×2 double] samp_err: 0.0067 samp_dprime: 4.9418 samp_dv: {[2300×1 double] [2300×1 double]} samp_opt_bd: [1×1 struct] samp_opt_dv: {[2300×1 double] [2300×1 double]} samp_opt_bd_pts: [3×26070 double] samp_opt_errmat: [2×2 double] samp_opt_err: 0.0026 samp_opt_dprime: 5.5866
axis normal
axis([-50 170 -320 200 0 1000]); view(166,40)
xlabel('template'); ylabel('silhouette'); zlabel('edge');

PAPER Actual vision research data: detecting camouflage

load camouflage_edge_data
results_joint_2=classify_normals([edge_powers_2(:,1),edge_lpr_2(:,1)],[edge_powers_2(:,2),edge_lpr_2(:,2)],'input_type','samp');
Iteration Func-count min f(x) Procedure 0 1 -1.99656e+06 1 7 -1.99716e+06 initial simplex 2 8 -1.99716e+06 reflect 3 10 -1.99716e+06 contract inside 4 12 -1.99716e+06 contract inside 5 14 -1.99716e+06 contract outside 6 16 -1.99716e+06 contract outside 7 18 -1.99716e+06 contract inside 8 20 -1.99716e+06 contract inside 9 21 -1.99716e+06 reflect 10 23 -1.99719e+06 contract inside 11 25 -1.99756e+06 contract inside 12 27 -1.99756e+06 contract inside 13 29 -1.99758e+06 contract inside 14 31 -1.99763e+06 contract inside 15 33 -1.99774e+06 contract inside 16 34 -1.99774e+06 reflect 17 36 -1.99774e+06 contract inside 18 38 -1.99778e+06 contract inside 19 39 -1.99778e+06 reflect 20 40 -1.99778e+06 reflect 21 42 -1.99778e+06 contract inside 22 43 -1.99778e+06 reflect 23 45 -1.99784e+06 contract inside 24 47 -1.99784e+06 contract inside 25 48 -1.99784e+06 reflect 26 50 -1.99784e+06 contract inside 27 52 -1.99784e+06 contract inside 28 54 -1.99784e+06 contract inside 29 55 -1.99784e+06 reflect 30 56 -1.99784e+06 reflect 31 58 -1.99784e+06 contract inside 32 60 -1.99784e+06 contract inside 33 62 -1.99785e+06 reflect 34 64 -1.99785e+06 contract outside 35 65 -1.99785e+06 reflect 36 67 -1.99785e+06 contract inside 37 69 -1.99785e+06 contract outside 38 70 -1.99785e+06 reflect 39 72 -1.99785e+06 contract inside 40 74 -1.99785e+06 contract inside 41 76 -1.99785e+06 contract inside 42 77 -1.99785e+06 reflect 43 79 -1.99785e+06 contract inside 44 81 -1.99785e+06 reflect 45 82 -1.99785e+06 reflect 46 83 -1.99785e+06 reflect 47 84 -1.99785e+06 reflect 48 86 -1.99785e+06 contract inside 49 88 -1.99785e+06 contract outside 50 90 -1.99785e+06 reflect 51 98 -1.99785e+06 shrink 52 100 -1.99785e+06 contract outside 53 102 -1.99785e+06 contract outside 54 104 -1.99785e+06 contract inside 55 106 -1.99786e+06 contract inside 56 107 -1.99786e+06 reflect 57 115 -1.99786e+06 shrink 58 123 -1.99786e+06 shrink 59 125 -1.99786e+06 contract inside 60 127 -1.99786e+06 contract outside 61 128 -1.99786e+06 reflect 62 129 -1.99786e+06 reflect 63 137 -1.99786e+06 shrink 64 138 -1.99786e+06 reflect 65 140 -1.99786e+06 contract inside 66 142 -1.99786e+06 contract inside 67 150 -1.99786e+06 shrink 68 151 -1.99786e+06 reflect 69 152 -1.99786e+06 reflect 70 153 -1.99786e+06 reflect 71 155 -1.99786e+06 contract inside 72 163 -1.99786e+06 shrink 73 171 -1.99786e+06 shrink 74 179 -1.99786e+06 shrink 75 187 -1.99786e+06 shrink 76 195 -1.99786e+06 shrink 77 203 -1.99786e+06 shrink 78 211 -1.99786e+06 shrink 79 219 -1.99786e+06 shrink 80 227 -1.99786e+06 shrink 81 235 -1.99786e+06 shrink 82 243 -1.99786e+06 shrink 83 251 -1.99786e+06 shrink 84 259 -1.99786e+06 shrink 85 267 -1.99786e+06 shrink 86 275 -1.99786e+06 shrink 87 283 -1.99786e+06 shrink 88 291 -1.99786e+06 shrink 89 299 -1.99786e+06 shrink 90 307 -1.99786e+06 shrink 91 315 -1.99786e+06 shrink 92 323 -1.99786e+06 shrink 93 331 -1.99786e+06 shrink 94 339 -1.99786e+06 shrink 95 347 -1.99786e+06 shrink 96 355 -1.99786e+06 shrink 97 363 -1.99786e+06 shrink 98 371 -1.99786e+06 shrink 99 379 -1.99786e+06 shrink 100 387 -1.99786e+06 shrink 101 395 -1.99786e+06 shrink 102 403 -1.99786e+06 shrink 103 411 -1.99786e+06 shrink 104 419 -1.99786e+06 shrink 105 427 -1.99786e+06 shrink 106 435 -1.99786e+06 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-07
axis([0.2 1 -900 400])
xlabel 'edge power'; ylabel 'edge spectrum'
results_dv_2=classify_normals(results_joint_2.samp_opt_dv{1},results_joint_2.samp_opt_dv{2},'input_type','samp','dom',@(x) x,'dom_type','fun','samp_opt',false);
axis([-50 100 0 .04])
xlabel('$q_s(${\boldmath$x$}$)$','interpreter','latex');
results_joint_4=classify_normals([edge_powers_4(:,1),edge_lpr_4(:,1)],[edge_powers_4(:,2),edge_lpr_4(:,2)],'input_type','samp','plotmode',false);
Iteration Func-count min f(x) Procedure 0 1 -1.9574e+06 1 7 -1.9574e+06 initial simplex 2 9 -1.9574e+06 contract inside 3 11 -1.9574e+06 contract outside 4 13 -1.9574e+06 contract outside 5 14 -1.9574e+06 reflect 6 16 -1.9574e+06 contract inside 7 18 -1.9574e+06 contract inside 8 20 -1.9574e+06 contract outside 9 22 -1.9574e+06 contract inside 10 24 -1.9574e+06 contract inside 11 26 -1.9574e+06 contract inside 12 28 -1.95741e+06 contract inside 13 30 -1.95782e+06 contract inside 14 32 -1.95782e+06 contract outside 15 34 -1.95783e+06 contract inside 16 36 -1.95808e+06 contract inside 17 37 -1.95808e+06 reflect 18 39 -1.95808e+06 contract inside 19 41 -1.95808e+06 contract inside 20 43 -1.95808e+06 contract inside 21 45 -1.95808e+06 contract inside 22 47 -1.95808e+06 contract inside 23 49 -1.95811e+06 contract inside 24 50 -1.95811e+06 reflect 25 52 -1.95811e+06 contract inside 26 54 -1.95811e+06 contract inside 27 56 -1.95814e+06 contract inside 28 58 -1.95818e+06 contract inside 29 60 -1.95819e+06 reflect 30 62 -1.95819e+06 contract inside 31 64 -1.95819e+06 contract inside 32 66 -1.95819e+06 contract inside 33 68 -1.95819e+06 contract inside 34 70 -1.9582e+06 contract inside 35 72 -1.9582e+06 contract inside 36 74 -1.9582e+06 contract inside 37 75 -1.9582e+06 reflect 38 77 -1.95822e+06 contract inside 39 78 -1.95822e+06 reflect 40 80 -1.95822e+06 contract inside 41 82 -1.95822e+06 contract inside 42 84 -1.95822e+06 contract inside 43 86 -1.95822e+06 contract inside 44 88 -1.95822e+06 contract inside 45 89 -1.95822e+06 reflect 46 90 -1.95822e+06 reflect 47 92 -1.95823e+06 expand 48 93 -1.95823e+06 reflect 49 95 -1.95823e+06 contract inside 50 96 -1.95823e+06 reflect 51 97 -1.95823e+06 reflect 52 99 -1.95824e+06 reflect 53 101 -1.95824e+06 contract inside 54 103 -1.95825e+06 expand 55 104 -1.95825e+06 reflect 56 106 -1.95825e+06 reflect 57 107 -1.95825e+06 reflect 58 115 -1.95825e+06 shrink 59 117 -1.95825e+06 contract inside 60 118 -1.95825e+06 reflect 61 120 -1.95825e+06 contract inside 62 122 -1.95826e+06 expand 63 123 -1.95826e+06 reflect 64 125 -1.95826e+06 contract inside 65 127 -1.95826e+06 contract inside 66 128 -1.95826e+06 reflect 67 130 -1.95827e+06 expand 68 132 -1.95827e+06 contract outside 69 133 -1.95827e+06 reflect 70 134 -1.95827e+06 reflect 71 135 -1.95827e+06 reflect 72 137 -1.95828e+06 expand 73 138 -1.95828e+06 reflect 74 140 -1.95828e+06 reflect 75 142 -1.95829e+06 expand 76 143 -1.95829e+06 reflect 77 145 -1.95829e+06 contract inside 78 147 -1.95834e+06 expand 79 148 -1.95834e+06 reflect 80 149 -1.95834e+06 reflect 81 150 -1.95834e+06 reflect 82 151 -1.95834e+06 reflect 83 153 -1.95838e+06 expand 84 154 -1.95838e+06 reflect 85 155 -1.95838e+06 reflect 86 156 -1.95838e+06 reflect 87 158 -1.9584e+06 expand 88 159 -1.9584e+06 reflect 89 161 -1.95846e+06 expand 90 162 -1.95846e+06 reflect 91 163 -1.95846e+06 reflect 92 164 -1.95846e+06 reflect 93 166 -1.9585e+06 expand 94 167 -1.9585e+06 reflect 95 169 -1.95856e+06 expand 96 170 -1.95856e+06 reflect 97 172 -1.95862e+06 expand 98 173 -1.95862e+06 reflect 99 174 -1.95862e+06 reflect 100 175 -1.95862e+06 reflect 101 177 -1.95865e+06 expand 102 178 -1.95865e+06 reflect 103 179 -1.95865e+06 reflect 104 180 -1.95865e+06 reflect 105 182 -1.95867e+06 expand 106 184 -1.95867e+06 contract outside 107 186 -1.95872e+06 expand 108 188 -1.95872e+06 contract inside 109 189 -1.95872e+06 reflect 110 191 -1.95872e+06 contract inside 111 192 -1.95872e+06 reflect 112 194 -1.95878e+06 expand 113 195 -1.95878e+06 reflect 114 196 -1.95878e+06 reflect 115 197 -1.95878e+06 reflect 116 199 -1.95888e+06 expand 117 200 -1.95888e+06 reflect 118 201 -1.95888e+06 reflect 119 203 -1.95898e+06 expand 120 204 -1.95898e+06 reflect 121 205 -1.95898e+06 reflect 122 207 -1.9591e+06 expand 123 208 -1.9591e+06 reflect 124 209 -1.9591e+06 reflect 125 211 -1.95917e+06 expand 126 213 -1.95933e+06 expand 127 214 -1.95933e+06 reflect 128 215 -1.95933e+06 reflect 129 217 -1.95945e+06 expand 130 218 -1.95945e+06 reflect 131 219 -1.95945e+06 reflect 132 221 -1.95961e+06 expand 133 222 -1.95961e+06 reflect 134 223 -1.95961e+06 reflect 135 225 -1.95961e+06 contract inside 136 227 -1.95964e+06 reflect 137 229 -1.95969e+06 reflect 138 230 -1.95969e+06 reflect 139 232 -1.95969e+06 contract inside 140 234 -1.95969e+06 contract inside 141 235 -1.95969e+06 reflect 142 236 -1.95969e+06 reflect 143 237 -1.95969e+06 reflect 144 238 -1.95969e+06 reflect 145 240 -1.95969e+06 contract outside 146 242 -1.95969e+06 contract inside 147 244 -1.95971e+06 reflect 148 246 -1.95976e+06 expand 149 248 -1.95976e+06 contract outside 150 249 -1.95976e+06 reflect 151 250 -1.95976e+06 reflect 152 252 -1.95981e+06 expand 153 253 -1.95981e+06 reflect 154 254 -1.95981e+06 reflect 155 256 -1.95996e+06 expand 156 257 -1.95996e+06 reflect 157 259 -1.96005e+06 expand 158 260 -1.96005e+06 reflect 159 262 -1.96018e+06 expand 160 263 -1.96018e+06 reflect 161 265 -1.96059e+06 expand 162 266 -1.96059e+06 reflect 163 267 -1.96059e+06 reflect 164 268 -1.96059e+06 reflect 165 270 -1.96078e+06 expand 166 272 -1.96114e+06 expand 167 274 -1.96135e+06 expand 168 275 -1.96135e+06 reflect 169 276 -1.96135e+06 reflect 170 277 -1.96135e+06 reflect 171 279 -1.96135e+06 contract inside 172 280 -1.96135e+06 reflect 173 282 -1.9615e+06 reflect 174 283 -1.9615e+06 reflect 175 285 -1.96172e+06 expand 176 287 -1.96179e+06 reflect 177 288 -1.96179e+06 reflect 178 290 -1.96179e+06 contract inside 179 291 -1.96179e+06 reflect 180 293 -1.96179e+06 contract inside 181 295 -1.96179e+06 contract inside 182 296 -1.96179e+06 reflect 183 298 -1.96179e+06 contract inside 184 300 -1.96179e+06 contract inside 185 302 -1.96183e+06 contract inside 186 304 -1.96188e+06 reflect 187 306 -1.96188e+06 contract inside 188 308 -1.96188e+06 contract inside 189 310 -1.9619e+06 contract inside 190 311 -1.9619e+06 reflect 191 313 -1.9619e+06 contract outside 192 314 -1.9619e+06 reflect 193 316 -1.96192e+06 reflect 194 318 -1.96195e+06 contract outside 195 319 -1.96195e+06 reflect 196 321 -1.96195e+06 contract inside 197 323 -1.96195e+06 contract inside 198 324 -1.96195e+06 reflect 199 325 -1.96195e+06 reflect 200 326 -1.96195e+06 reflect 201 328 -1.96195e+06 contract outside 202 330 -1.96195e+06 contract inside 203 331 -1.96195e+06 reflect 204 333 -1.96195e+06 contract inside 205 335 -1.96195e+06 contract inside 206 336 -1.96195e+06 reflect 207 338 -1.96195e+06 contract inside 208 339 -1.96195e+06 reflect 209 341 -1.96195e+06 contract inside 210 342 -1.96195e+06 reflect 211 350 -1.96196e+06 shrink 212 351 -1.96196e+06 reflect 213 353 -1.96196e+06 contract outside 214 354 -1.96196e+06 reflect 215 356 -1.96196e+06 contract inside 216 358 -1.96196e+06 contract outside 217 359 -1.96196e+06 reflect 218 360 -1.96196e+06 reflect 219 362 -1.96196e+06 contract inside 220 364 -1.96196e+06 contract inside 221 365 -1.96196e+06 reflect 222 367 -1.96196e+06 contract inside 223 368 -1.96196e+06 reflect 224 376 -1.96196e+06 shrink 225 377 -1.96196e+06 reflect 226 379 -1.96196e+06 contract outside 227 381 -1.96196e+06 contract inside 228 389 -1.96197e+06 shrink 229 391 -1.96197e+06 contract inside 230 392 -1.96197e+06 reflect 231 393 -1.96197e+06 reflect 232 395 -1.96197e+06 contract outside 233 396 -1.96197e+06 reflect 234 398 -1.96197e+06 contract inside 235 399 -1.96197e+06 reflect 236 400 -1.96197e+06 reflect 237 401 -1.96197e+06 reflect 238 409 -1.96197e+06 shrink 239 411 -1.96197e+06 contract inside 240 412 -1.96197e+06 reflect 241 414 -1.96197e+06 contract inside 242 415 -1.96197e+06 reflect 243 423 -1.96197e+06 shrink 244 424 -1.96197e+06 reflect 245 426 -1.96197e+06 contract outside 246 434 -1.96197e+06 shrink 247 442 -1.96197e+06 shrink 248 444 -1.96197e+06 contract inside 249 446 -1.96197e+06 contract inside 250 454 -1.96197e+06 shrink 251 462 -1.96197e+06 shrink 252 470 -1.96197e+06 shrink 253 478 -1.96197e+06 shrink 254 486 -1.96197e+06 shrink 255 494 -1.96197e+06 shrink 256 502 -1.96197e+06 shrink 257 510 -1.96197e+06 shrink 258 518 -1.96197e+06 shrink 259 526 -1.96197e+06 shrink 260 534 -1.96197e+06 shrink 261 542 -1.96197e+06 shrink 262 550 -1.96197e+06 shrink 263 558 -1.96197e+06 shrink 264 566 -1.96197e+06 shrink 265 574 -1.96197e+06 shrink 266 582 -1.96197e+06 shrink 267 590 -1.96197e+06 shrink 268 598 -1.96197e+06 shrink 269 606 -1.96197e+06 shrink 270 614 -1.96197e+06 shrink 271 622 -1.96197e+06 shrink 272 630 -1.96197e+06 shrink 273 638 -1.96197e+06 shrink 274 646 -1.96197e+06 shrink 275 654 -1.96197e+06 shrink 276 662 -1.96197e+06 shrink 277 670 -1.96197e+06 shrink 278 678 -1.96197e+06 shrink 279 686 -1.96197e+06 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-07
results_joint_8=classify_normals([edge_powers_8(:,1),edge_lpr_8(:,1)],[edge_powers_8(:,2),edge_lpr_8(:,2)],'input_type','samp','plotmode',false);
Iteration Func-count min f(x) Procedure 0 1 -1.78592e+06 1 7 -1.78592e+06 initial simplex 2 9 -1.78592e+06 contract inside 3 11 -1.78592e+06 contract inside 4 13 -1.78592e+06 contract inside 5 15 -1.78699e+06 contract outside 6 17 -1.78713e+06 contract inside 7 19 -1.78734e+06 contract outside 8 21 -1.78746e+06 contract inside 9 23 -1.78777e+06 contract inside 10 25 -1.78777e+06 contract inside 11 27 -1.7878e+06 contract inside 12 29 -1.78788e+06 contract outside 13 31 -1.78788e+06 contract outside 14 33 -1.78792e+06 contract inside 15 35 -1.78837e+06 reflect 16 36 -1.78837e+06 reflect 17 38 -1.78837e+06 contract inside 18 39 -1.78837e+06 reflect 19 41 -1.78837e+06 contract inside 20 43 -1.78837e+06 contract inside 21 44 -1.78837e+06 reflect 22 46 -1.78893e+06 expand 23 47 -1.78893e+06 reflect 24 48 -1.78893e+06 reflect 25 49 -1.78893e+06 reflect 26 50 -1.78893e+06 reflect 27 51 -1.78893e+06 reflect 28 53 -1.78903e+06 expand 29 54 -1.78903e+06 reflect 30 56 -1.78903e+06 contract inside 31 58 -1.78924e+06 expand 32 59 -1.78924e+06 reflect 33 61 -1.7893e+06 reflect 34 63 -1.78992e+06 expand 35 64 -1.78992e+06 reflect 36 66 -1.78992e+06 contract inside 37 67 -1.78992e+06 reflect 38 69 -1.78996e+06 expand 39 71 -1.78999e+06 reflect 40 73 -1.79056e+06 expand 41 74 -1.79056e+06 reflect 42 76 -1.79157e+06 expand 43 77 -1.79157e+06 reflect 44 78 -1.79157e+06 reflect 45 79 -1.79157e+06 reflect 46 81 -1.79183e+06 reflect 47 83 -1.79314e+06 expand 48 84 -1.79314e+06 reflect 49 85 -1.79314e+06 reflect 50 87 -1.79341e+06 expand 51 89 -1.79449e+06 expand 52 91 -1.79567e+06 expand 53 92 -1.79567e+06 reflect 54 93 -1.79567e+06 reflect 55 95 -1.79608e+06 expand 56 97 -1.79781e+06 expand 57 99 -1.79889e+06 expand 58 101 -1.79889e+06 contract inside 59 102 -1.79889e+06 reflect 60 103 -1.79889e+06 reflect 61 104 -1.79889e+06 reflect 62 105 -1.79889e+06 reflect 63 107 -1.79889e+06 contract inside 64 108 -1.79889e+06 reflect 65 110 -1.79907e+06 reflect 66 112 -1.79907e+06 contract outside 67 114 -1.79907e+06 contract inside 68 115 -1.79907e+06 reflect 69 116 -1.79907e+06 reflect 70 118 -1.79914e+06 contract inside 71 120 -1.79914e+06 contract inside 72 122 -1.79927e+06 reflect 73 123 -1.79927e+06 reflect 74 125 -1.79927e+06 contract inside 75 127 -1.79927e+06 contract inside 76 128 -1.79927e+06 reflect 77 130 -1.79927e+06 contract inside 78 132 -1.79928e+06 contract inside 79 134 -1.79928e+06 contract inside 80 136 -1.79928e+06 contract inside 81 137 -1.79928e+06 reflect 82 139 -1.79928e+06 contract inside 83 140 -1.79928e+06 reflect 84 142 -1.79928e+06 contract outside 85 144 -1.79928e+06 contract inside 86 145 -1.79928e+06 reflect 87 146 -1.79928e+06 reflect 88 148 -1.79928e+06 contract inside 89 149 -1.79928e+06 reflect 90 150 -1.79928e+06 reflect 91 158 -1.79928e+06 shrink 92 160 -1.79928e+06 contract outside 93 161 -1.79928e+06 reflect 94 162 -1.79928e+06 reflect 95 164 -1.79931e+06 expand 96 166 -1.79931e+06 contract inside 97 168 -1.79931e+06 contract inside 98 176 -1.79931e+06 shrink 99 177 -1.79931e+06 reflect 100 178 -1.79931e+06 reflect 101 179 -1.79931e+06 reflect 102 180 -1.79931e+06 reflect 103 182 -1.79931e+06 contract inside 104 190 -1.79932e+06 shrink 105 191 -1.79932e+06 reflect 106 192 -1.79932e+06 reflect 107 194 -1.79932e+06 contract inside 108 196 -1.79932e+06 contract inside 109 198 -1.79932e+06 contract inside 110 200 -1.79932e+06 contract inside 111 208 -1.79932e+06 shrink 112 210 -1.79932e+06 contract outside 113 212 -1.79932e+06 contract inside 114 213 -1.79932e+06 reflect 115 215 -1.79933e+06 reflect 116 217 -1.79933e+06 contract inside 117 219 -1.79933e+06 contract inside 118 227 -1.79933e+06 shrink 119 229 -1.79933e+06 contract inside 120 231 -1.79933e+06 contract inside 121 233 -1.79933e+06 contract inside 122 234 -1.79933e+06 reflect 123 236 -1.79933e+06 contract inside 124 237 -1.79933e+06 reflect 125 239 -1.79933e+06 contract inside 126 240 -1.79933e+06 reflect 127 248 -1.79933e+06 shrink 128 249 -1.79933e+06 reflect 129 250 -1.79933e+06 reflect 130 251 -1.79933e+06 reflect 131 252 -1.79933e+06 reflect 132 254 -1.79933e+06 contract inside 133 255 -1.79933e+06 reflect 134 257 -1.79933e+06 contract outside 135 265 -1.79933e+06 shrink 136 267 -1.79933e+06 contract outside 137 268 -1.79933e+06 reflect 138 270 -1.79933e+06 contract inside 139 272 -1.79933e+06 contract inside 140 274 -1.79933e+06 contract inside 141 282 -1.79933e+06 shrink 142 284 -1.79933e+06 contract inside 143 286 -1.79933e+06 contract inside 144 288 -1.79933e+06 contract inside 145 296 -1.79933e+06 shrink 146 298 -1.79933e+06 contract inside 147 306 -1.79933e+06 shrink 148 314 -1.79933e+06 shrink 149 322 -1.79933e+06 shrink 150 330 -1.79933e+06 shrink 151 338 -1.79933e+06 shrink 152 346 -1.79933e+06 shrink 153 354 -1.79933e+06 shrink 154 362 -1.79933e+06 shrink 155 363 -1.79933e+06 reflect 156 365 -1.79933e+06 contract outside 157 373 -1.79933e+06 shrink 158 381 -1.79933e+06 shrink 159 389 -1.79933e+06 shrink 160 397 -1.79933e+06 shrink 161 405 -1.79933e+06 shrink 162 413 -1.79933e+06 shrink 163 421 -1.79933e+06 shrink 164 429 -1.79933e+06 shrink 165 437 -1.79933e+06 shrink 166 445 -1.79933e+06 shrink 167 453 -1.79933e+06 shrink 168 461 -1.79933e+06 shrink 169 469 -1.79933e+06 shrink 170 477 -1.79933e+06 shrink 171 485 -1.79933e+06 shrink 172 493 -1.79933e+06 shrink 173 501 -1.79933e+06 shrink 174 509 -1.79933e+06 shrink 175 517 -1.79933e+06 shrink 176 525 -1.79933e+06 shrink 177 533 -1.79933e+06 shrink 178 541 -1.79933e+06 shrink 179 549 -1.79933e+06 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-07
results_dv_joint=classify_normals([results_joint_2.samp_opt_dv{1},results_joint_4.samp_opt_dv{1},results_joint_8.samp_opt_dv{1}],[results_joint_2.samp_opt_dv{2},results_joint_4.samp_opt_dv{2},results_joint_8.samp_opt_dv{2}],'input_type','samp');
Iteration Func-count min f(x) Procedure 0 1 -1.99145e+06 1 11 -1.9929e+06 initial simplex 2 12 -1.9929e+06 reflect 3 13 -1.9929e+06 reflect 4 14 -1.9929e+06 reflect 5 15 -1.9929e+06 reflect 6 16 -1.9929e+06 reflect 7 17 -1.9929e+06 reflect 8 19 -1.99367e+06 expand 9 20 -1.99367e+06 reflect 10 22 -1.99445e+06 expand 11 23 -1.99445e+06 reflect 12 24 -1.99445e+06 reflect 13 25 -1.99445e+06 reflect 14 26 -1.99445e+06 reflect 15 27 -1.99445e+06 reflect 16 29 -1.99523e+06 expand 17 30 -1.99523e+06 reflect 18 32 -1.99604e+06 expand 19 33 -1.99604e+06 reflect 20 34 -1.99604e+06 reflect 21 35 -1.99604e+06 reflect 22 36 -1.99604e+06 reflect 23 37 -1.99604e+06 reflect 24 39 -1.99682e+06 expand 25 40 -1.99682e+06 reflect 26 41 -1.99682e+06 reflect 27 42 -1.99682e+06 reflect 28 43 -1.99682e+06 reflect 29 45 -1.99721e+06 expand 30 46 -1.99721e+06 reflect 31 47 -1.99721e+06 reflect 32 48 -1.99721e+06 reflect 33 49 -1.99721e+06 reflect 34 50 -1.99721e+06 reflect 35 51 -1.99721e+06 reflect 36 53 -1.99734e+06 expand 37 54 -1.99734e+06 reflect 38 55 -1.99734e+06 reflect 39 57 -1.99782e+06 expand 40 58 -1.99782e+06 reflect 41 59 -1.99782e+06 reflect 42 60 -1.99782e+06 reflect 43 61 -1.99782e+06 reflect 44 63 -1.99782e+06 contract outside 45 64 -1.99782e+06 reflect 46 65 -1.99782e+06 reflect 47 67 -1.99796e+06 expand 48 69 -1.99796e+06 contract inside 49 70 -1.99796e+06 reflect 50 71 -1.99796e+06 reflect 51 72 -1.99796e+06 reflect 52 74 -1.99806e+06 expand 53 75 -1.99806e+06 reflect 54 76 -1.99806e+06 reflect 55 78 -1.99806e+06 reflect 56 80 -1.99809e+06 expand 57 81 -1.99809e+06 reflect 58 82 -1.99809e+06 reflect 59 84 -1.9981e+06 reflect 60 85 -1.9981e+06 reflect 61 86 -1.9981e+06 reflect 62 87 -1.9981e+06 reflect 63 89 -1.9981e+06 contract inside 64 91 -1.9981e+06 contract inside 65 93 -1.9981e+06 contract inside 66 94 -1.9981e+06 reflect 67 96 -1.9981e+06 contract inside 68 98 -1.9981e+06 contract inside 69 99 -1.9981e+06 reflect 70 101 -1.9981e+06 contract inside 71 103 -1.9981e+06 contract inside 72 104 -1.9981e+06 reflect 73 106 -1.9981e+06 contract inside 74 108 -1.9981e+06 contract inside 75 110 -1.9981e+06 reflect 76 111 -1.9981e+06 reflect 77 113 -1.9981e+06 contract inside 78 115 -1.9981e+06 contract inside 79 116 -1.9981e+06 reflect 80 118 -1.99811e+06 reflect 81 119 -1.99811e+06 reflect 82 120 -1.99811e+06 reflect 83 121 -1.99811e+06 reflect 84 123 -1.99811e+06 contract inside 85 125 -1.99811e+06 contract outside 86 126 -1.99811e+06 reflect 87 127 -1.99811e+06 reflect 88 128 -1.99811e+06 reflect 89 130 -1.99811e+06 contract inside 90 132 -1.99812e+06 expand 91 134 -1.99812e+06 contract outside 92 136 -1.99812e+06 contract inside 93 138 -1.99812e+06 contract inside 94 139 -1.99812e+06 reflect 95 140 -1.99812e+06 reflect 96 142 -1.99812e+06 contract inside 97 144 -1.99812e+06 contract inside 98 145 -1.99812e+06 reflect 99 146 -1.99812e+06 reflect 100 158 -1.99812e+06 shrink 101 160 -1.99812e+06 contract outside 102 161 -1.99812e+06 reflect 103 162 -1.99812e+06 reflect 104 164 -1.99812e+06 contract outside 105 166 -1.99812e+06 contract inside 106 168 -1.99812e+06 contract inside 107 170 -1.99812e+06 contract outside 108 171 -1.99812e+06 reflect 109 172 -1.99812e+06 reflect 110 174 -1.99812e+06 contract inside 111 176 -1.99812e+06 contract inside 112 178 -1.99812e+06 contract outside 113 180 -1.99812e+06 contract inside 114 181 -1.99812e+06 reflect 115 193 -1.99812e+06 shrink 116 194 -1.99812e+06 reflect 117 195 -1.99812e+06 reflect 118 196 -1.99812e+06 reflect 119 208 -1.99812e+06 shrink 120 210 -1.99812e+06 contract outside 121 212 -1.99812e+06 contract outside 122 213 -1.99812e+06 reflect 123 215 -1.99812e+06 contract outside 124 227 -1.99812e+06 shrink 125 228 -1.99812e+06 reflect 126 229 -1.99812e+06 reflect 127 230 -1.99812e+06 reflect 128 231 -1.99812e+06 reflect 129 232 -1.99812e+06 reflect 130 233 -1.99812e+06 reflect 131 235 -1.99812e+06 contract outside 132 247 -1.99812e+06 shrink 133 248 -1.99812e+06 reflect 134 260 -1.99812e+06 shrink 135 272 -1.99812e+06 shrink 136 273 -1.99812e+06 reflect 137 285 -1.99812e+06 shrink 138 287 -1.99812e+06 contract inside 139 299 -1.99812e+06 shrink 140 311 -1.99812e+06 shrink 141 323 -1.99812e+06 shrink 142 335 -1.99812e+06 shrink 143 347 -1.99812e+06 shrink 144 359 -1.99812e+06 shrink 145 371 -1.99812e+06 shrink 146 383 -1.99812e+06 shrink 147 395 -1.99812e+06 shrink 148 407 -1.99812e+06 shrink 149 419 -1.99812e+06 shrink 150 431 -1.99812e+06 shrink 151 443 -1.99812e+06 shrink 152 455 -1.99812e+06 shrink 153 467 -1.99812e+06 shrink 154 479 -1.99812e+06 shrink 155 491 -1.99812e+06 shrink 156 503 -1.99812e+06 shrink 157 515 -1.99812e+06 shrink 158 527 -1.99812e+06 shrink 159 539 -1.99812e+06 shrink 160 551 -1.99812e+06 shrink 161 563 -1.99812e+06 shrink 162 575 -1.99812e+06 shrink 163 587 -1.99812e+06 shrink 164 599 -1.99812e+06 shrink 165 611 -1.99812e+06 shrink 166 623 -1.99812e+06 shrink 167 635 -1.99812e+06 shrink 168 647 -1.99812e+06 shrink 169 659 -1.99812e+06 shrink 170 671 -1.99812e+06 shrink 171 683 -1.99812e+06 shrink 172 695 -1.99812e+06 shrink 173 707 -1.99812e+06 shrink 174 719 -1.99812e+06 shrink 175 731 -1.99812e+06 shrink 176 743 -1.99812e+06 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-07
axis image; axis([-100 125 -50 75 -50 50]); view(-20,24)
xlabel('$q_s(${\boldmath$x$}$)$ (2px)','interpreter','latex');
ylabel('$q_s(${\boldmath$x$}$)$ (4px)','interpreter','latex');
zlabel('$q_s(${\boldmath$x$}$)$ (8px)','interpreter','latex');
results_all=classify_normals([edge_powers_2(:,1),edge_lpr_2(:,1),...
edge_powers_4(:,1),edge_lpr_4(:,1),...
edge_powers_8(:,1),edge_lpr_8(:,1)],...
[edge_powers_2(:,2),edge_lpr_2(:,2),...
edge_powers_4(:,2),edge_lpr_4(:,2),...
edge_powers_8(:,2),edge_lpr_8(:,2)],'input_type','samp');
Iteration Func-count min f(x) Procedure 0 1 -1.99471e+06 1 29 -1.99689e+06 initial simplex 2 30 -1.99689e+06 reflect 3 31 -1.99689e+06 reflect 4 32 -1.99689e+06 reflect 5 34 -1.99689e+06 contract inside 6 36 -1.99689e+06 contract inside 7 38 -1.99689e+06 contract inside 8 40 -1.99689e+06 contract inside 9 41 -1.99689e+06 reflect 10 43 -1.99689e+06 contract inside 11 45 -1.99689e+06 contract inside 12 46 -1.99689e+06 reflect 13 48 -1.99689e+06 contract inside 14 50 -1.99689e+06 contract inside 15 52 -1.99689e+06 contract inside 16 54 -1.99691e+06 contract inside 17 56 -1.99718e+06 reflect 18 57 -1.99718e+06 reflect 19 59 -1.99721e+06 contract inside 20 61 -1.99749e+06 reflect 21 63 -1.99749e+06 contract inside 22 64 -1.99749e+06 reflect 23 65 -1.99749e+06 reflect 24 66 -1.99749e+06 reflect 25 67 -1.99749e+06 reflect 26 68 -1.99749e+06 reflect 27 69 -1.99749e+06 reflect 28 70 -1.99749e+06 reflect 29 72 -1.99749e+06 contract inside 30 74 -1.99749e+06 contract inside 31 76 -1.99749e+06 contract inside 32 78 -1.99749e+06 contract inside 33 80 -1.99749e+06 contract inside 34 82 -1.99749e+06 contract inside 35 84 -1.99749e+06 contract inside 36 86 -1.99749e+06 contract inside 37 88 -1.99749e+06 contract inside 38 90 -1.99749e+06 contract inside 39 91 -1.99749e+06 reflect 40 93 -1.99749e+06 contract outside 41 94 -1.99749e+06 reflect 42 96 -1.99749e+06 contract inside 43 98 -1.99749e+06 contract inside 44 100 -1.99749e+06 contract inside 45 101 -1.99749e+06 reflect 46 102 -1.99749e+06 reflect 47 103 -1.99749e+06 reflect 48 104 -1.99749e+06 reflect 49 106 -1.99749e+06 contract inside 50 108 -1.99749e+06 contract inside 51 110 -1.99749e+06 contract inside 52 112 -1.99749e+06 contract inside 53 114 -1.99749e+06 contract inside 54 116 -1.99749e+06 contract inside 55 118 -1.99749e+06 contract inside 56 119 -1.99749e+06 reflect 57 121 -1.99749e+06 contract inside 58 122 -1.99749e+06 reflect 59 124 -1.99749e+06 contract outside 60 126 -1.99749e+06 contract inside 61 128 -1.99752e+06 contract inside 62 130 -1.99752e+06 contract inside 63 132 -1.99752e+06 contract inside 64 133 -1.99752e+06 reflect 65 135 -1.99752e+06 contract outside 66 137 -1.99752e+06 contract inside 67 139 -1.99752e+06 contract inside 68 141 -1.99752e+06 contract inside 69 143 -1.99754e+06 contract inside 70 145 -1.99757e+06 contract inside 71 146 -1.99757e+06 reflect 72 148 -1.99757e+06 contract outside 73 150 -1.99757e+06 contract outside 74 151 -1.99757e+06 reflect 75 152 -1.99757e+06 reflect 76 154 -1.99757e+06 contract inside 77 155 -1.99757e+06 reflect 78 156 -1.99757e+06 reflect 79 158 -1.99758e+06 contract inside 80 159 -1.99758e+06 reflect 81 161 -1.99758e+06 contract inside 82 163 -1.99758e+06 contract inside 83 164 -1.99758e+06 reflect 84 166 -1.99758e+06 contract inside 85 167 -1.99758e+06 reflect 86 168 -1.99758e+06 reflect 87 170 -1.99758e+06 contract inside 88 171 -1.99758e+06 reflect 89 172 -1.99758e+06 reflect 90 173 -1.99758e+06 reflect 91 175 -1.99759e+06 contract inside 92 176 -1.99759e+06 reflect 93 178 -1.99759e+06 contract inside 94 179 -1.99759e+06 reflect 95 181 -1.99759e+06 contract inside 96 183 -1.9976e+06 contract inside 97 184 -1.9976e+06 reflect 98 186 -1.9976e+06 contract outside 99 188 -1.9976e+06 contract inside 100 190 -1.99761e+06 contract inside 101 192 -1.99761e+06 contract inside 102 193 -1.99761e+06 reflect 103 194 -1.99761e+06 reflect 104 195 -1.99761e+06 reflect 105 197 -1.99761e+06 contract inside 106 198 -1.99761e+06 reflect 107 199 -1.99761e+06 reflect 108 200 -1.99761e+06 reflect 109 201 -1.99761e+06 reflect 110 202 -1.99761e+06 reflect 111 203 -1.99761e+06 reflect 112 205 -1.99761e+06 contract inside 113 206 -1.99761e+06 reflect 114 207 -1.99761e+06 reflect 115 209 -1.99761e+06 contract inside 116 211 -1.99762e+06 reflect 117 213 -1.99762e+06 contract inside 118 215 -1.99762e+06 contract inside 119 216 -1.99762e+06 reflect 120 217 -1.99762e+06 reflect 121 218 -1.99762e+06 reflect 122 220 -1.99762e+06 contract inside 123 221 -1.99762e+06 reflect 124 222 -1.99762e+06 reflect 125 223 -1.99762e+06 reflect 126 224 -1.99762e+06 reflect 127 226 -1.99762e+06 contract inside 128 228 -1.99763e+06 reflect 129 229 -1.99763e+06 reflect 130 231 -1.99763e+06 contract inside 131 232 -1.99763e+06 reflect 132 234 -1.99763e+06 contract inside 133 235 -1.99763e+06 reflect 134 237 -1.99765e+06 reflect 135 238 -1.99765e+06 reflect 136 239 -1.99765e+06 reflect 137 240 -1.99765e+06 reflect 138 242 -1.99766e+06 reflect 139 243 -1.99766e+06 reflect 140 244 -1.99766e+06 reflect 141 245 -1.99766e+06 reflect 142 247 -1.99766e+06 contract inside 143 249 -1.99766e+06 contract inside 144 250 -1.99766e+06 reflect 145 251 -1.99766e+06 reflect 146 252 -1.99766e+06 reflect 147 253 -1.99766e+06 reflect 148 255 -1.99766e+06 contract inside 149 257 -1.99766e+06 contract inside 150 259 -1.99766e+06 contract inside 151 261 -1.99766e+06 contract inside 152 263 -1.99766e+06 contract inside 153 265 -1.99768e+06 expand 154 266 -1.99768e+06 reflect 155 267 -1.99768e+06 reflect 156 269 -1.99768e+06 contract inside 157 271 -1.99768e+06 contract inside 158 272 -1.99768e+06 reflect 159 274 -1.99768e+06 contract inside 160 275 -1.99768e+06 reflect 161 276 -1.99768e+06 reflect 162 277 -1.99768e+06 reflect 163 278 -1.99768e+06 reflect 164 279 -1.99768e+06 reflect 165 280 -1.99768e+06 reflect 166 281 -1.99768e+06 reflect 167 282 -1.99768e+06 reflect 168 283 -1.99768e+06 reflect 169 284 -1.99768e+06 reflect 170 285 -1.99768e+06 reflect 171 287 -1.99768e+06 contract outside 172 288 -1.99768e+06 reflect 173 290 -1.9977e+06 reflect 174 291 -1.9977e+06 reflect 175 292 -1.9977e+06 reflect 176 293 -1.9977e+06 reflect 177 294 -1.9977e+06 reflect 178 295 -1.9977e+06 reflect 179 297 -1.9977e+06 contract inside 180 298 -1.9977e+06 reflect 181 299 -1.9977e+06 reflect 182 300 -1.9977e+06 reflect 183 301 -1.9977e+06 reflect 184 302 -1.9977e+06 reflect 185 303 -1.9977e+06 reflect 186 304 -1.9977e+06 reflect 187 305 -1.9977e+06 reflect 188 306 -1.9977e+06 reflect 189 307 -1.9977e+06 reflect 190 308 -1.9977e+06 reflect 191 309 -1.9977e+06 reflect 192 310 -1.9977e+06 reflect 193 311 -1.9977e+06 reflect 194 312 -1.9977e+06 reflect 195 313 -1.9977e+06 reflect 196 314 -1.9977e+06 reflect 197 316 -1.9977e+06 contract inside 198 317 -1.9977e+06 reflect 199 318 -1.9977e+06 reflect 200 319 -1.9977e+06 reflect 201 320 -1.9977e+06 reflect 202 322 -1.99774e+06 expand 203 323 -1.99774e+06 reflect 204 324 -1.99774e+06 reflect 205 326 -1.99774e+06 contract inside 206 327 -1.99774e+06 reflect 207 329 -1.99774e+06 contract inside 208 330 -1.99774e+06 reflect 209 331 -1.99774e+06 reflect 210 333 -1.99774e+06 contract inside 211 335 -1.99774e+06 contract inside 212 336 -1.99774e+06 reflect 213 337 -1.99774e+06 reflect 214 338 -1.99774e+06 reflect 215 339 -1.99774e+06 reflect 216 340 -1.99774e+06 reflect 217 342 -1.99774e+06 contract inside 218 344 -1.99774e+06 contract inside 219 345 -1.99774e+06 reflect 220 347 -1.99774e+06 contract inside 221 348 -1.99774e+06 reflect 222 349 -1.99774e+06 reflect 223 350 -1.99774e+06 reflect 224 351 -1.99774e+06 reflect 225 352 -1.99774e+06 reflect 226 353 -1.99774e+06 reflect 227 354 -1.99774e+06 reflect 228 355 -1.99774e+06 reflect 229 356 -1.99774e+06 reflect 230 357 -1.99774e+06 reflect 231 358 -1.99774e+06 reflect 232 359 -1.99774e+06 reflect 233 361 -1.99777e+06 expand 234 363 -1.99777e+06 contract inside 235 364 -1.99777e+06 reflect 236 365 -1.99777e+06 reflect 237 366 -1.99777e+06 reflect 238 367 -1.99777e+06 reflect 239 368 -1.99777e+06 reflect 240 369 -1.99777e+06 reflect 241 370 -1.99777e+06 reflect 242 371 -1.99777e+06 reflect 243 372 -1.99777e+06 reflect 244 373 -1.99777e+06 reflect 245 374 -1.99777e+06 reflect 246 375 -1.99777e+06 reflect 247 376 -1.99777e+06 reflect 248 377 -1.99777e+06 reflect 249 378 -1.99777e+06 reflect 250 379 -1.99777e+06 reflect 251 381 -1.99777e+06 contract inside 252 382 -1.99777e+06 reflect 253 383 -1.99777e+06 reflect 254 384 -1.99777e+06 reflect 255 385 -1.99777e+06 reflect 256 386 -1.99777e+06 reflect 257 388 -1.99777e+06 contract inside 258 389 -1.99777e+06 reflect 259 391 -1.9978e+06 expand 260 392 -1.9978e+06 reflect 261 393 -1.9978e+06 reflect 262 394 -1.9978e+06 reflect 263 395 -1.9978e+06 reflect 264 396 -1.9978e+06 reflect 265 397 -1.9978e+06 reflect 266 398 -1.9978e+06 reflect 267 399 -1.9978e+06 reflect 268 400 -1.9978e+06 reflect 269 401 -1.9978e+06 reflect 270 402 -1.9978e+06 reflect 271 404 -1.9978e+06 contract inside 272 405 -1.9978e+06 reflect 273 407 -1.9978e+06 reflect 274 408 -1.9978e+06 reflect 275 409 -1.9978e+06 reflect 276 410 -1.9978e+06 reflect 277 411 -1.9978e+06 reflect 278 412 -1.9978e+06 reflect 279 413 -1.9978e+06 reflect 280 414 -1.9978e+06 reflect 281 416 -1.99781e+06 expand 282 417 -1.99781e+06 reflect 283 418 -1.99781e+06 reflect 284 419 -1.99781e+06 reflect 285 420 -1.99781e+06 reflect 286 421 -1.99781e+06 reflect 287 422 -1.99781e+06 reflect 288 424 -1.99783e+06 expand 289 425 -1.99783e+06 reflect 290 426 -1.99783e+06 reflect 291 427 -1.99783e+06 reflect 292 428 -1.99783e+06 reflect 293 430 -1.99786e+06 expand 294 431 -1.99786e+06 reflect 295 432 -1.99786e+06 reflect 296 433 -1.99786e+06 reflect 297 434 -1.99786e+06 reflect 298 435 -1.99786e+06 reflect 299 436 -1.99786e+06 reflect 300 437 -1.99786e+06 reflect 301 438 -1.99786e+06 reflect 302 439 -1.99786e+06 reflect 303 440 -1.99786e+06 reflect 304 441 -1.99786e+06 reflect 305 442 -1.99786e+06 reflect 306 443 -1.99786e+06 reflect 307 444 -1.99786e+06 reflect 308 445 -1.99786e+06 reflect 309 446 -1.99786e+06 reflect 310 447 -1.99786e+06 reflect 311 448 -1.99786e+06 reflect 312 449 -1.99786e+06 reflect 313 450 -1.99786e+06 reflect 314 451 -1.99786e+06 reflect 315 452 -1.99786e+06 reflect 316 453 -1.99786e+06 reflect 317 454 -1.99786e+06 reflect 318 455 -1.99786e+06 reflect 319 456 -1.99786e+06 reflect 320 457 -1.99786e+06 reflect 321 458 -1.99786e+06 reflect 322 459 -1.99786e+06 reflect 323 460 -1.99786e+06 reflect 324 461 -1.99786e+06 reflect 325 462 -1.99786e+06 reflect 326 463 -1.99786e+06 reflect 327 464 -1.99786e+06 reflect 328 466 -1.99786e+06 contract inside 329 467 -1.99786e+06 reflect 330 468 -1.99786e+06 reflect 331 469 -1.99786e+06 reflect 332 470 -1.99786e+06 reflect 333 471 -1.99786e+06 reflect 334 472 -1.99786e+06 reflect 335 473 -1.99786e+06 reflect 336 474 -1.99786e+06 reflect 337 476 -1.99786e+06 contract inside 338 477 -1.99786e+06 reflect 339 478 -1.99786e+06 reflect 340 479 -1.99786e+06 reflect 341 481 -1.99786e+06 contract inside 342 482 -1.99786e+06 reflect 343 483 -1.99786e+06 reflect 344 484 -1.99786e+06 reflect 345 486 -1.99786e+06 contract inside 346 488 -1.99786e+06 contract inside 347 489 -1.99786e+06 reflect 348 490 -1.99786e+06 reflect 349 491 -1.99786e+06 reflect 350 492 -1.99786e+06 reflect 351 494 -1.99786e+06 contract inside 352 495 -1.99786e+06 reflect 353 496 -1.99786e+06 reflect 354 498 -1.99786e+06 contract inside 355 499 -1.99786e+06 reflect 356 500 -1.99786e+06 reflect 357 502 -1.99786e+06 contract inside 358 503 -1.99786e+06 reflect 359 505 -1.99786e+06 contract inside 360 506 -1.99786e+06 reflect 361 508 -1.99786e+06 reflect 362 510 -1.99787e+06 reflect 363 511 -1.99787e+06 reflect 364 512 -1.99787e+06 reflect 365 513 -1.99787e+06 reflect 366 515 -1.99789e+06 reflect 367 516 -1.99789e+06 reflect 368 517 -1.99789e+06 reflect 369 518 -1.99789e+06 reflect 370 519 -1.99789e+06 reflect 371 520 -1.99789e+06 reflect 372 521 -1.99789e+06 reflect 373 522 -1.99789e+06 reflect 374 523 -1.99789e+06 reflect 375 524 -1.99789e+06 reflect 376 525 -1.99789e+06 reflect 377 526 -1.99789e+06 reflect 378 527 -1.99789e+06 reflect 379 528 -1.99789e+06 reflect 380 529 -1.99789e+06 reflect 381 530 -1.99789e+06 reflect 382 531 -1.99789e+06 reflect 383 532 -1.99789e+06 reflect 384 533 -1.99789e+06 reflect 385 534 -1.99789e+06 reflect 386 535 -1.99789e+06 reflect 387 536 -1.99789e+06 reflect 388 538 -1.9979e+06 expand 389 539 -1.9979e+06 reflect 390 540 -1.9979e+06 reflect 391 541 -1.9979e+06 reflect 392 542 -1.9979e+06 reflect 393 543 -1.9979e+06 reflect 394 544 -1.9979e+06 reflect 395 545 -1.9979e+06 reflect 396 546 -1.9979e+06 reflect 397 547 -1.9979e+06 reflect 398 548 -1.9979e+06 reflect 399 549 -1.9979e+06 reflect 400 550 -1.9979e+06 reflect 401 551 -1.9979e+06 reflect 402 552 -1.9979e+06 reflect 403 553 -1.9979e+06 reflect 404 555 -1.99793e+06 expand 405 556 -1.99793e+06 reflect 406 557 -1.99793e+06 reflect 407 558 -1.99793e+06 reflect 408 559 -1.99793e+06 reflect 409 560 -1.99793e+06 reflect 410 561 -1.99793e+06 reflect 411 562 -1.99793e+06 reflect 412 563 -1.99793e+06 reflect 413 564 -1.99793e+06 reflect 414 565 -1.99793e+06 reflect 415 566 -1.99793e+06 reflect 416 567 -1.99793e+06 reflect 417 568 -1.99793e+06 reflect 418 569 -1.99793e+06 reflect 419 570 -1.99793e+06 reflect 420 571 -1.99793e+06 reflect 421 572 -1.99793e+06 reflect 422 573 -1.99793e+06 reflect 423 574 -1.99793e+06 reflect 424 576 -1.99795e+06 expand 425 577 -1.99795e+06 reflect 426 578 -1.99795e+06 reflect 427 579 -1.99795e+06 reflect 428 580 -1.99795e+06 reflect 429 581 -1.99795e+06 reflect 430 582 -1.99795e+06 reflect 431 583 -1.99795e+06 reflect 432 584 -1.99795e+06 reflect 433 585 -1.99795e+06 reflect 434 586 -1.99795e+06 reflect 435 587 -1.99795e+06 reflect 436 588 -1.99795e+06 reflect 437 590 -1.99797e+06 expand 438 591 -1.99797e+06 reflect 439 592 -1.99797e+06 reflect 440 593 -1.99797e+06 reflect 441 594 -1.99797e+06 reflect 442 595 -1.99797e+06 reflect 443 596 -1.99797e+06 reflect 444 597 -1.99797e+06 reflect 445 598 -1.99797e+06 reflect 446 599 -1.99797e+06 reflect 447 601 -1.99799e+06 expand 448 602 -1.99799e+06 reflect 449 603 -1.99799e+06 reflect 450 604 -1.99799e+06 reflect 451 605 -1.99799e+06 reflect 452 606 -1.99799e+06 reflect 453 607 -1.99799e+06 reflect 454 609 -1.99801e+06 expand 455 610 -1.99801e+06 reflect 456 611 -1.99801e+06 reflect 457 612 -1.99801e+06 reflect 458 614 -1.99803e+06 expand 459 615 -1.99803e+06 reflect 460 616 -1.99803e+06 reflect 461 617 -1.99803e+06 reflect 462 618 -1.99803e+06 reflect 463 619 -1.99803e+06 reflect 464 620 -1.99803e+06 reflect 465 621 -1.99803e+06 reflect 466 622 -1.99803e+06 reflect 467 623 -1.99803e+06 reflect 468 624 -1.99803e+06 reflect 469 625 -1.99803e+06 reflect 470 626 -1.99803e+06 reflect 471 627 -1.99803e+06 reflect 472 628 -1.99803e+06 reflect 473 629 -1.99803e+06 reflect 474 630 -1.99803e+06 reflect 475 631 -1.99803e+06 reflect 476 632 -1.99803e+06 reflect 477 633 -1.99803e+06 reflect 478 634 -1.99803e+06 reflect 479 635 -1.99803e+06 reflect 480 637 -1.99806e+06 expand 481 638 -1.99806e+06 reflect 482 639 -1.99806e+06 reflect 483 640 -1.99806e+06 reflect 484 641 -1.99806e+06 reflect 485 642 -1.99806e+06 reflect 486 643 -1.99806e+06 reflect 487 644 -1.99806e+06 reflect 488 645 -1.99806e+06 reflect 489 646 -1.99806e+06 reflect 490 647 -1.99806e+06 reflect 491 649 -1.99808e+06 expand 492 650 -1.99808e+06 reflect 493 651 -1.99808e+06 reflect 494 652 -1.99808e+06 reflect 495 653 -1.99808e+06 reflect 496 654 -1.99808e+06 reflect 497 655 -1.99808e+06 reflect 498 656 -1.99808e+06 reflect 499 657 -1.99808e+06 reflect 500 658 -1.99808e+06 reflect 501 659 -1.99808e+06 reflect 502 660 -1.99808e+06 reflect 503 662 -1.99811e+06 expand 504 663 -1.99811e+06 reflect 505 664 -1.99811e+06 reflect 506 665 -1.99811e+06 reflect 507 666 -1.99811e+06 reflect 508 667 -1.99811e+06 reflect 509 668 -1.99811e+06 reflect 510 669 -1.99811e+06 reflect 511 670 -1.99811e+06 reflect 512 671 -1.99811e+06 reflect 513 672 -1.99811e+06 reflect 514 673 -1.99811e+06 reflect 515 674 -1.99811e+06 reflect 516 675 -1.99811e+06 reflect 517 676 -1.99811e+06 reflect 518 678 -1.99815e+06 expand 519 679 -1.99815e+06 reflect 520 680 -1.99815e+06 reflect 521 681 -1.99815e+06 reflect 522 682 -1.99815e+06 reflect 523 683 -1.99815e+06 reflect 524 684 -1.99815e+06 reflect 525 685 -1.99815e+06 reflect 526 686 -1.99815e+06 reflect 527 687 -1.99815e+06 reflect 528 688 -1.99815e+06 reflect 529 689 -1.99815e+06 reflect 530 690 -1.99815e+06 reflect 531 691 -1.99815e+06 reflect 532 692 -1.99815e+06 reflect 533 693 -1.99815e+06 reflect 534 695 -1.99817e+06 expand 535 697 -1.99818e+06 expand 536 698 -1.99818e+06 reflect 537 699 -1.99818e+06 reflect 538 700 -1.99818e+06 reflect 539 701 -1.99818e+06 reflect 540 702 -1.99818e+06 reflect 541 703 -1.99818e+06 reflect 542 704 -1.99818e+06 reflect 543 706 -1.9982e+06 expand 544 707 -1.9982e+06 reflect 545 708 -1.9982e+06 reflect 546 709 -1.9982e+06 reflect 547 710 -1.9982e+06 reflect 548 711 -1.9982e+06 reflect 549 712 -1.9982e+06 reflect 550 713 -1.9982e+06 reflect 551 714 -1.9982e+06 reflect 552 716 -1.99822e+06 expand 553 717 -1.99822e+06 reflect 554 718 -1.99822e+06 reflect 555 719 -1.99822e+06 reflect 556 720 -1.99822e+06 reflect 557 721 -1.99822e+06 reflect 558 722 -1.99822e+06 reflect 559 724 -1.99825e+06 expand 560 725 -1.99825e+06 reflect 561 726 -1.99825e+06 reflect 562 727 -1.99825e+06 reflect 563 728 -1.99825e+06 reflect 564 729 -1.99825e+06 reflect 565 730 -1.99825e+06 reflect 566 731 -1.99825e+06 reflect 567 732 -1.99825e+06 reflect 568 733 -1.99825e+06 reflect 569 734 -1.99825e+06 reflect 570 736 -1.99826e+06 expand 571 738 -1.99827e+06 expand 572 739 -1.99827e+06 reflect 573 740 -1.99827e+06 reflect 574 741 -1.99827e+06 reflect 575 742 -1.99827e+06 reflect 576 743 -1.99827e+06 reflect 577 744 -1.99827e+06 reflect 578 745 -1.99827e+06 reflect 579 746 -1.99827e+06 reflect 580 747 -1.99827e+06 reflect 581 749 -1.9983e+06 expand 582 750 -1.9983e+06 reflect 583 751 -1.9983e+06 reflect 584 752 -1.9983e+06 reflect 585 753 -1.9983e+06 reflect 586 754 -1.9983e+06 reflect 587 755 -1.9983e+06 reflect 588 756 -1.9983e+06 reflect 589 757 -1.9983e+06 reflect 590 758 -1.9983e+06 reflect 591 760 -1.99831e+06 expand 592 761 -1.99831e+06 reflect 593 762 -1.99831e+06 reflect 594 763 -1.99831e+06 reflect 595 764 -1.99831e+06 reflect 596 765 -1.99831e+06 reflect 597 766 -1.99831e+06 reflect 598 767 -1.99831e+06 reflect 599 768 -1.99831e+06 reflect 600 769 -1.99831e+06 reflect 601 770 -1.99831e+06 reflect 602 771 -1.99831e+06 reflect 603 772 -1.99831e+06 reflect 604 773 -1.99831e+06 reflect 605 774 -1.99831e+06 reflect 606 775 -1.99831e+06 reflect 607 776 -1.99831e+06 reflect 608 777 -1.99831e+06 reflect 609 778 -1.99831e+06 reflect 610 779 -1.99831e+06 reflect 611 780 -1.99831e+06 reflect 612 781 -1.99831e+06 reflect 613 782 -1.99831e+06 reflect 614 783 -1.99831e+06 reflect 615 784 -1.99831e+06 reflect 616 785 -1.99831e+06 reflect 617 786 -1.99831e+06 reflect 618 788 -1.99832e+06 reflect 619 789 -1.99832e+06 reflect 620 790 -1.99832e+06 reflect 621 791 -1.99832e+06 reflect 622 792 -1.99832e+06 reflect 623 793 -1.99832e+06 reflect 624 794 -1.99832e+06 reflect 625 795 -1.99832e+06 reflect 626 796 -1.99832e+06 reflect 627 797 -1.99832e+06 reflect 628 798 -1.99832e+06 reflect 629 799 -1.99832e+06 reflect 630 801 -1.99832e+06 contract inside 631 802 -1.99832e+06 reflect 632 803 -1.99832e+06 reflect 633 805 -1.99832e+06 contract inside 634 807 -1.99832e+06 contract inside 635 808 -1.99832e+06 reflect 636 809 -1.99832e+06 reflect 637 810 -1.99832e+06 reflect 638 811 -1.99832e+06 reflect 639 812 -1.99832e+06 reflect 640 814 -1.99832e+06 contract inside 641 815 -1.99832e+06 reflect 642 817 -1.99832e+06 contract inside 643 818 -1.99832e+06 reflect 644 819 -1.99832e+06 reflect 645 820 -1.99832e+06 reflect 646 822 -1.99833e+06 contract inside 647 823 -1.99833e+06 reflect 648 825 -1.99833e+06 contract inside 649 827 -1.99833e+06 contract inside 650 829 -1.99833e+06 contract inside 651 831 -1.99833e+06 contract inside 652 833 -1.99833e+06 contract inside 653 834 -1.99833e+06 reflect 654 835 -1.99833e+06 reflect 655 837 -1.99833e+06 contract inside 656 839 -1.99833e+06 contract inside 657 841 -1.99833e+06 contract outside 658 842 -1.99833e+06 reflect 659 843 -1.99833e+06 reflect 660 845 -1.99833e+06 contract inside 661 846 -1.99833e+06 reflect 662 847 -1.99833e+06 reflect 663 848 -1.99833e+06 reflect 664 849 -1.99833e+06 reflect 665 850 -1.99833e+06 reflect 666 851 -1.99833e+06 reflect 667 852 -1.99833e+06 reflect 668 854 -1.99833e+06 contract inside 669 855 -1.99833e+06 reflect 670 856 -1.99833e+06 reflect 671 857 -1.99833e+06 reflect 672 858 -1.99833e+06 reflect 673 859 -1.99833e+06 reflect 674 860 -1.99833e+06 reflect 675 861 -1.99833e+06 reflect 676 891 -1.99833e+06 shrink 677 893 -1.99833e+06 contract outside 678 894 -1.99833e+06 reflect 679 895 -1.99833e+06 reflect 680 896 -1.99833e+06 reflect 681 897 -1.99833e+06 reflect 682 898 -1.99833e+06 reflect 683 899 -1.99833e+06 reflect 684 900 -1.99833e+06 reflect 685 902 -1.99833e+06 contract inside 686 904 -1.99833e+06 contract inside 687 905 -1.99833e+06 reflect 688 906 -1.99833e+06 reflect 689 908 -1.99833e+06 contract inside 690 910 -1.99833e+06 contract inside 691 912 -1.99833e+06 contract inside 692 913 -1.99833e+06 reflect 693 915 -1.99833e+06 contract inside 694 917 -1.99833e+06 contract inside 695 919 -1.99833e+06 contract inside 696 921 -1.99833e+06 contract inside 697 923 -1.99833e+06 contract inside 698 925 -1.99833e+06 contract inside 699 926 -1.99833e+06 reflect 700 928 -1.99833e+06 contract inside 701 929 -1.99833e+06 reflect 702 931 -1.99833e+06 contract inside 703 932 -1.99833e+06 reflect 704 934 -1.99833e+06 contract inside 705 935 -1.99833e+06 reflect 706 965 -1.99833e+06 shrink 707 966 -1.99833e+06 reflect 708 968 -1.99833e+06 contract inside 709 970 -1.99833e+06 contract inside 710 972 -1.99833e+06 contract inside 711 974 -1.99833e+06 contract inside 712 975 -1.99833e+06 reflect 713 976 -1.99833e+06 reflect 714 977 -1.99833e+06 reflect 715 979 -1.99833e+06 contract inside 716 981 -1.99833e+06 contract inside 717 982 -1.99833e+06 reflect 718 983 -1.99833e+06 reflect 719 984 -1.99833e+06 reflect 720 986 -1.99833e+06 contract inside 721 987 -1.99833e+06 reflect 722 988 -1.99833e+06 reflect 723 990 -1.99833e+06 contract inside 724 992 -1.99833e+06 contract inside 725 993 -1.99833e+06 reflect 726 994 -1.99833e+06 reflect 727 995 -1.99833e+06 reflect 728 997 -1.99833e+06 contract inside 729 1027 -1.99833e+06 shrink 730 1028 -1.99833e+06 reflect 731 1029 -1.99833e+06 reflect 732 1031 -1.99833e+06 contract inside 733 1032 -1.99833e+06 reflect 734 1033 -1.99833e+06 reflect 735 1034 -1.99833e+06 reflect 736 1036 -1.99833e+06 contract inside 737 1037 -1.99833e+06 reflect 738 1038 -1.99833e+06 reflect 739 1039 -1.99833e+06 reflect 740 1041 -1.99833e+06 contract inside 741 1043 -1.99833e+06 contract inside 742 1045 -1.99833e+06 contract inside 743 1075 -1.99833e+06 shrink 744 1076 -1.99833e+06 reflect 745 1078 -1.99833e+06 contract inside 746 1108 -1.99833e+06 shrink 747 1109 -1.99833e+06 reflect 748 1110 -1.99833e+06 reflect 749 1111 -1.99833e+06 reflect 750 1112 -1.99833e+06 reflect 751 1113 -1.99833e+06 reflect 752 1114 -1.99833e+06 reflect 753 1144 -1.99833e+06 shrink 754 1145 -1.99833e+06 reflect 755 1175 -1.99833e+06 shrink 756 1177 -1.99833e+06 contract inside 757 1179 -1.99833e+06 contract inside 758 1180 -1.99833e+06 reflect 759 1182 -1.99833e+06 contract outside 760 1212 -1.99833e+06 shrink 761 1242 -1.99833e+06 shrink 762 1272 -1.99833e+06 shrink 763 1302 -1.99833e+06 shrink 764 1332 -1.99833e+06 shrink 765 1362 -1.99833e+06 shrink 766 1392 -1.99833e+06 shrink 767 1422 -1.99833e+06 shrink 768 1452 -1.99833e+06 shrink 769 1482 -1.99833e+06 shrink 770 1512 -1.99833e+06 shrink 771 1542 -1.99833e+06 shrink 772 1572 -1.99833e+06 shrink 773 1602 -1.99833e+06 shrink 774 1632 -1.99833e+06 shrink 775 1662 -1.99833e+06 shrink 776 1692 -1.99833e+06 shrink 777 1722 -1.99833e+06 shrink 778 1752 -1.99833e+06 shrink 779 1782 -1.99833e+06 shrink 780 1812 -1.99833e+06 shrink 781 1842 -1.99833e+06 shrink 782 1872 -1.99833e+06 shrink 783 1902 -1.99833e+06 shrink 784 1932 -1.99833e+06 shrink 785 1962 -1.99833e+06 shrink 786 1992 -1.99833e+06 shrink 787 2022 -1.99833e+06 shrink 788 2052 -1.99833e+06 shrink 789 2082 -1.99833e+06 shrink 790 2112 -1.99833e+06 shrink 791 2142 -1.99833e+06 shrink 792 2172 -1.99833e+06 shrink 793 2202 -1.99833e+06 shrink 794 2232 -1.99833e+06 shrink Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 0.000000e+00 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 5.000000e-07
results_all_samp_opt=classify_normals([edge_powers_2(:,1),edge_lpr_2(:,1),...
edge_powers_4(:,1),edge_lpr_4(:,1),...
edge_powers_8(:,1),edge_lpr_8(:,1)],...
[edge_powers_2(:,2),edge_lpr_2(:,2),...
edge_powers_4(:,2),edge_lpr_4(:,2),...
edge_powers_8(:,2),edge_lpr_8(:,2)],'input_type','samp',...
'dom',results_all.samp_opt_bd,'samp_opt',false);
xlabel('$q_s(${\boldmath$x$}$)$ (2, 4 and 8px)','interpreter','latex');
axis([-125 150 0 .015])